index int64 0 50.7k | project_path stringclasses 279
values | completion_path stringlengths 57 199 | signature_postion stringlengths 3 11 | class_position stringlengths 3 11 | function_name stringlengths 1 62 | class_name stringlengths 0 55 | body_position stringlengths 3 11 | body_position_with_comments stringlengths 3 11 | masked_class stringlengths 14 8.32k | masked_class_with_comment stringlengths 14 8.32k | func_body stringlengths 9 6.72k | func_body_with_comment stringlengths 9 6.72k | len_func_body int64 1 643 | len_input int64 10 2.02k | len_output int64 4 1.9k | total int64 20 2.05k | file_code stringlengths 14 442k | file_code_with_comment stringlengths 14 442k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41,076 | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi/pyVmomi/Iso8601.py | 92,94 | 88,103 | GetTZInfo | TZManager | 95,103 | 94,103 | class TZManager:
""" Time zone manager """
_tzInfos = {}
@staticmethod
def GetTZInfo(tzname='UTC', utcOffset=None, dst=None):
FILL_FUNC_BODY | class TZManager:
""" Time zone manager """
_tzInfos = {}
@staticmethod
def GetTZInfo(tzname='UTC', utcOffset=None, dst=None):
""" Get / Add timezone info """
FILL_FUNC_BODY | key = (tzname, utcOffset, dst)
tzInfo = TZManager._tzInfos.get(key)
if not tzInfo:
tzInfo = TZInfo(tzname, utcOffset, dst)
TZManager._tzInfos[key] = tzInfo
return tzInfo
| """ Get / Add timezone info """
key = (tzname, utcOffset, dst)
tzInfo = TZManager._tzInfos.get(key)
if not tzInfo:
tzInfo = TZInfo(tzname, utcOffset, dst)
TZManager._tzInfos[key] = tzInfo
return tzInfo
| 21 | 73 | 93 | 166 | #!/usr/bin/env python
"""
Copyright (c) 2009-2022 VMware, Inc.
This module is for ISO 8601 parsing
"""
__author__ = 'VMware, Inc'
import re
import time
from datetime import datetime, timedelta, tzinfo
import six
# Regular expression to parse a subset of ISO 8601 format
_dtExpr = re.compile(
# XMLSchema datetime... | #!/usr/bin/env python
"""
Copyright (c) 2009-2022 VMware, Inc.
This module is for ISO 8601 parsing
"""
__author__ = 'VMware, Inc'
import re
import time
from datetime import datetime, timedelta, tzinfo
import six
# Regular expression to parse a subset of ISO 8601 format
_dtExpr = re.compile(
# XMLSchema datetime... |
41,077 | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi/pyVmomi/Security.py | 31,32 | 1,55 | VerifyCertThumbprint | 32,48 | 32,48 | #!/usr/bin/env python
"""
Copyright (c) 2022 VMware, Inc.
This module is the python vmomi client security module.
"""
__author__ = "VMware, Inc"
import hashlib
_isSha1Enabled = True
_isSha256Enabled = True
_isSha512Enabled = True
def SetSha1Enabled(state):
global _isSha1Enabled
_isSha1Enabled = state
def... | #!/usr/bin/env python
"""
Copyright (c) 2022 VMware, Inc.
This module is the python vmomi client security module.
"""
__author__ = "VMware, Inc"
import hashlib
_isSha1Enabled = True
_isSha256Enabled = True
_isSha512Enabled = True
def SetSha1Enabled(state):
global _isSha1Enabled
_isSha1Enabled = state
def... | thumbprint_len = len(thumbprint)
if thumbprint_len == 40 and _isSha1Enabled:
sha = hashlib.sha1()
elif thumbprint_len == 64 and _isSha256Enabled:
sha = hashlib.sha256()
elif thumbprint_len == 128 and _isSha512Enabled:
sha = hashlib.sha512()
else:
raise ThumbprintMisma... | thumbprint_len = len(thumbprint)
if thumbprint_len == 40 and _isSha1Enabled:
sha = hashlib.sha1()
elif thumbprint_len == 64 and _isSha256Enabled:
sha = hashlib.sha256()
elif thumbprint_len == 128 and _isSha512Enabled:
sha = hashlib.sha512()
else:
raise ThumbprintMisma... | 46 | 302 | 202 | 504 | #!/usr/bin/env python
"""
Copyright (c) 2022 VMware, Inc.
This module is the python vmomi client security module.
"""
__author__ = "VMware, Inc"
import hashlib
_isSha1Enabled = True
_isSha256Enabled = True
_isSha512Enabled = True
def SetSha1Enabled(state):
global _isSha1Enabled
_isSha1Enabled = state
def... | #!/usr/bin/env python
"""
Copyright (c) 2022 VMware, Inc.
This module is the python vmomi client security module.
"""
__author__ = "VMware, Inc"
import hashlib
_isSha1Enabled = True
_isSha256Enabled = True
_isSha512Enabled = True
def SetSha1Enabled(state):
global _isSha1Enabled
_isSha1Enabled = state
def... | |
41,078 | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi/pyVmomi/StubAdapterAccessorImpl.py | 27,28 | 20,62 | InvokeAccessor | StubAdapterAccessorMixin | 28,60 | 28,60 | class StubAdapterAccessorMixin(object):
# Retrieve a managed property
#
# @param self The object pointer
# @param mo managed object
# @param info property info
def InvokeAccessor(self, mo, info):
FILL_FUNC_BODY def SupportServerGUIDs(self):
return False
| class StubAdapterAccessorMixin(object):
# Retrieve a managed property
#
# @param self The object pointer
# @param mo managed object
# @param info property info
def InvokeAccessor(self, mo, info):
FILL_FUNC_BODY def SupportServerGUIDs(self):
return False
| prop = info.name
param = Object(name="prop", type=str, version=self.version, flags=0)
# Emulate legacy behavior for backward compatibility
replacement = _legacyTypes.get(info.type.__name__, None)
if replacement:
info.type = GetVmodlType(replacement)
# When t... | prop = info.name
param = Object(name="prop", type=str, version=self.version, flags=0)
# Emulate legacy behavior for backward compatibility
replacement = _legacyTypes.get(info.type.__name__, None)
if replacement:
info.type = GetVmodlType(replacement)
# When t... | 94 | 88 | 374 | 462 | # **********************************************************
# Copyright (c) 2011-2023 VMware, Inc.
# **********************************************************
from .VmomiSupport import GetVmodlType, ManagedObject, Object
# Used to replace few type definitions for emulating
# legacy behavior. Ref. VmomiSupport._wsd... | # **********************************************************
# Copyright (c) 2011-2023 VMware, Inc.
# **********************************************************
from .VmomiSupport import GetVmodlType, ManagedObject, Object
# Used to replace few type definitions for emulating
# legacy behavior. Ref. VmomiSupport._wsd... |
41,079 | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi/pyVmomi/Version.py | 17,22 | 1,28 | AddVersion | 22,26 | 22,26 | # **********************************************************
# Copyright (c) 2008-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc.
# and/or its subsidiaries.
# **********************************************************
from .VmomiSupport import CreateVersion, parentMap
kind = "OSS"
#... | # **********************************************************
# Copyright (c) 2008-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc.
# and/or its subsidiaries.
# **********************************************************
from .VmomiSupport import CreateVersion, parentMap
kind = "OSS"
#... | CreateVersion(version, ns, versionId, isLegacy, serviceNs)
# Check if a version is a child of another
| CreateVersion(version, ns, versionId, isLegacy, serviceNs)
# Check if a version is a child of another
| 15 | 175 | 37 | 212 | # **********************************************************
# Copyright (c) 2008-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc.
# and/or its subsidiaries.
# **********************************************************
from .VmomiSupport import CreateVersion, parentMap
kind = "OSS"
#... | # **********************************************************
# Copyright (c) 2008-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc.
# and/or its subsidiaries.
# **********************************************************
from .VmomiSupport import CreateVersion, parentMap
kind = "OSS"
#... | |
41,080 | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi/pyVmomi/VmomiJSONEncoder.py | 127,128 | 1,130 | templateOf | 129,130 | 128,130 | """
Copyright (c) 2022 VMware, Inc.
"""
import base64
import json
from datetime import datetime
from six import PY3
from . import Iso8601
from .VmomiSupport import ManagedObject, DataObject, ManagedMethod, \
UnknownManagedMethod, GetWsdlType, XMLNS_VMODL_BASE, binary
class VmomiJSONEncoder(json.JSONEncoder):
... | """
Copyright (c) 2022 VMware, Inc.
"""
import base64
import json
from datetime import datetime
from six import PY3
from . import Iso8601
from .VmomiSupport import ManagedObject, DataObject, ManagedMethod, \
UnknownManagedMethod, GetWsdlType, XMLNS_VMODL_BASE, binary
class VmomiJSONEncoder(json.JSONEncoder):
... | return GetWsdlType(XMLNS_VMODL_BASE, typestr)
| """ Returns a class template. """
return GetWsdlType(XMLNS_VMODL_BASE, typestr)
| 3 | 1,491 | 23 | 1,514 | """
Copyright (c) 2022 VMware, Inc.
"""
import base64
import json
from datetime import datetime
from six import PY3
from . import Iso8601
from .VmomiSupport import ManagedObject, DataObject, ManagedMethod, \
UnknownManagedMethod, GetWsdlType, XMLNS_VMODL_BASE, binary
class VmomiJSONEncoder(json.JSONEncoder):
... | """
Copyright (c) 2022 VMware, Inc.
"""
import base64
import json
from datetime import datetime
from six import PY3
from . import Iso8601
from .VmomiSupport import ManagedObject, DataObject, ManagedMethod, \
UnknownManagedMethod, GetWsdlType, XMLNS_VMODL_BASE, binary
class VmomiJSONEncoder(json.JSONEncoder):
... | |
41,081 | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi/pyVmomi/VmomiJSONEncoder.py | 108,109 | 16,127 | explode | VmomiJSONEncoder | 110,127 | 109,127 | class VmomiJSONEncoder(json.JSONEncoder):
"""
Custom JSON encoder to encode vSphere objects.
When a ManagedObject is encoded, it gains three properties:
_vimid is the _moId (ex: 'vm-42')
_vimref is the moRef (ex: 'vim.VirtualMachine:vm-42')
_vimtype is the class n... | class VmomiJSONEncoder(json.JSONEncoder):
"""
Custom JSON encoder to encode vSphere objects.
When a ManagedObject is encoded, it gains three properties:
_vimid is the _moId (ex: 'vm-42')
_vimref is the moRef (ex: 'vim.VirtualMachine:vm-42')
_vimtype is the class n... | if obj in self._done:
return False
result = False
for item in self._explode:
if hasattr(item, '_moId'):
# If it has a _moId it is an instance
if obj._moId == item._moId:
result = True
else:
# ... | """ Determine if the object should be exploded. """
if obj in self._done:
return False
result = False
for item in self._explode:
if hasattr(item, '_moId'):
# If it has a _moId it is an instance
if obj._moId == item._moId:
... | 58 | 1,241 | 152 | 1,393 | """
Copyright (c) 2022 VMware, Inc.
"""
import base64
import json
from datetime import datetime
from six import PY3
from . import Iso8601
from .VmomiSupport import ManagedObject, DataObject, ManagedMethod, \
UnknownManagedMethod, GetWsdlType, XMLNS_VMODL_BASE, binary
class VmomiJSONEncoder(json.JSONEncoder):
... | """
Copyright (c) 2022 VMware, Inc.
"""
import base64
import json
from datetime import datetime
from six import PY3
from . import Iso8601
from .VmomiSupport import ManagedObject, DataObject, ManagedMethod, \
UnknownManagedMethod, GetWsdlType, XMLNS_VMODL_BASE, binary
class VmomiJSONEncoder(json.JSONEncoder):
... |
41,082 | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi/pyVmomi/_typeinfos.py | 8,9 | 1,60 | load_typeinfos | 9,55 | 9,55 | # Copyright (c) 2005-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc.
# and/or its subsidiaries.
import sys
def load_typeinfos():
FILL_FUNC_BODYfrom .VmomiJSONEncoder import VmomiJSONEncoder
from .VmomiJSONEncoder import templateOf
VmomiSupport = sys.modules['pyVmomi.VmomiSupport']
s... | # Copyright (c) 2005-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc.
# and/or its subsidiaries.
import sys
def load_typeinfos():
FILL_FUNC_BODYfrom .VmomiJSONEncoder import VmomiJSONEncoder
from .VmomiJSONEncoder import templateOf
VmomiSupport = sys.modules['pyVmomi.VmomiSupport']
s... | try:
from . import _typeinfo_core
except ImportError:
pass
try:
from . import _typeinfo_eam
except ImportError:
pass
try:
from . import _typeinfo_pbm
except ImportError:
pass
try:
from . import _typeinfo_query
except ImportError:... | try:
from . import _typeinfo_core
except ImportError:
pass
try:
from . import _typeinfo_eam
except ImportError:
pass
try:
from . import _typeinfo_pbm
except ImportError:
pass
try:
from . import _typeinfo_query
except ImportError:... | 88 | 162 | 320 | 482 | # Copyright (c) 2005-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc.
# and/or its subsidiaries.
import sys
def load_typeinfos():
FILL_FUNC_BODYfrom .VmomiJSONEncoder import VmomiJSONEncoder
from .VmomiJSONEncoder import templateOf
VmomiSupport = sys.modules['pyVmomi.VmomiSupport']
s... | # Copyright (c) 2005-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc.
# and/or its subsidiaries.
import sys
def load_typeinfos():
FILL_FUNC_BODYfrom .VmomiJSONEncoder import VmomiJSONEncoder
from .VmomiJSONEncoder import templateOf
VmomiSupport = sys.modules['pyVmomi.VmomiSupport']
s... | |
41,083 | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi | /home/hieuvd/dung_repo/raw/stars_02/vmware_pyvmomi/pyvmomi/setup.py | 33,34 | 1,95 | getTypeAnnotationsPackageData | 34,44 | 34,44 | # VMware vSphere Python SDK
# Copyright (c) 2009-2021 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | # VMware vSphere Python SDK
# Copyright (c) 2009-2021 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | allFiles = []
for root, dirs, files in os.walk(os.path.join(os.path.dirname(__file__), 'pyVmomi')):
for file in files:
if file.endswith('.pyi'):
fileRelPath = os.path.relpath(str(os.path.join(root, file)))
allFiles.append(fileRelPath.split(os.path.sep, 1)[1])
... | allFiles = []
for root, dirs, files in os.walk(os.path.join(os.path.dirname(__file__), 'pyVmomi')):
for file in files:
if file.endswith('.pyi'):
fileRelPath = os.path.relpath(str(os.path.join(root, file)))
allFiles.append(fileRelPath.split(os.path.sep, 1)[1])
... | 25 | 955 | 140 | 1,095 | # VMware vSphere Python SDK
# Copyright (c) 2009-2021 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | # VMware vSphere Python SDK
# Copyright (c) 2009-2021 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
41,144 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/games/abstract_game.py | 72,73 | 4,106 | human_to_action | AbstractGame | 80,85 | 73,85 | class AbstractGame(ABC):
"""
Inherit this class for muzero to play
"""
@abstractmethod
def __init__(self, seed=None):
pass
@abstractmethod
def step(self, action):
"""
Apply action to the game.
Args:
action : action of the action_space to take.
... | class AbstractGame(ABC):
"""
Inherit this class for muzero to play
"""
@abstractmethod
def __init__(self, seed=None):
pass
@abstractmethod
def step(self, action):
"""
Apply action to the game.
Args:
action : action of the action_space to take.
... | choice = input(f"Enter the action to play for the player {self.to_play()}: ")
while int(choice) not in self.legal_actions():
choice = input("Illegal action. Enter another action : ")
return int(choice)
| """
For multiplayer games, ask the user for a legal action
and return the corresponding action number.
Returns:
An integer from the action space.
"""
choice = input(f"Enter the action to play for the player {self.to_play()}: ")
while int(choice) not i... | 28 | 612 | 68 | 680 | from abc import ABC, abstractmethod
class AbstractGame(ABC):
"""
Inherit this class for muzero to play
"""
@abstractmethod
def __init__(self, seed=None):
pass
@abstractmethod
def step(self, action):
"""
Apply action to the game.
Args:
action :... | from abc import ABC, abstractmethod
class AbstractGame(ABC):
"""
Inherit this class for muzero to play
"""
@abstractmethod
def __init__(self, seed=None):
pass
@abstractmethod
def step(self, action):
"""
Apply action to the game.
Args:
action :... |
41,146 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 72,73 | 56,80 | set_weights | AbstractNetwork | 73,80 | 73,80 | class AbstractNetwork(ABC, torch.nn.Module):
def __init__(self):
super().__init__()
pass
@abstractmethod
def initial_inference(self, observation):
pass
@abstractmethod
def recurrent_inference(self, encoded_state, action):
pass
def get_weights(self):
ret... | class AbstractNetwork(ABC, torch.nn.Module):
def __init__(self):
super().__init__()
pass
@abstractmethod
def initial_inference(self, observation):
pass
@abstractmethod
def recurrent_inference(self, encoded_state, action):
pass
def get_weights(self):
ret... | self.load_state_dict(weights)
##################################
######## Fully Connected #########
| self.load_state_dict(weights)
##################################
######## Fully Connected #########
| 6 | 132 | 35 | 167 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,147 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 264,265 | 233,278 | forward | DownSample | 265,278 | 265,278 | class DownSample(torch.nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.conv1 = torch.nn.Conv2d(
in_channels,
out_channels // 2,
kernel_size=3,
stride=2,
padding=1,
bias=False,
)
... | class DownSample(torch.nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.conv1 = torch.nn.Conv2d(
in_channels,
out_channels // 2,
kernel_size=3,
stride=2,
padding=1,
bias=False,
)
... | x = self.conv1(x)
for block in self.resblocks1:
x = block(x)
x = self.conv2(x)
for block in self.resblocks2:
x = block(x)
x = self.pooling1(x)
for block in self.resblocks3:
x = block(x)
x = self.pooling2(x)
return x
| x = self.conv1(x)
for block in self.resblocks1:
x = block(x)
x = self.conv2(x)
for block in self.resblocks2:
x = block(x)
x = self.pooling1(x)
for block in self.resblocks3:
x = block(x)
x = self.pooling2(x)
return x
| 35 | 371 | 122 | 493 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,148 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 294,295 | 278,300 | forward | DownsampleCNN | 295,300 | 295,300 | class DownsampleCNN(torch.nn.Module):
def __init__(self, in_channels, out_channels, h_w):
super().__init__()
mid_channels = (in_channels + out_channels) // 2
self.features = torch.nn.Sequential(
torch.nn.Conv2d(
in_channels, mid_channels, kernel_size=h_w[0] * 2, s... | class DownsampleCNN(torch.nn.Module):
def __init__(self, in_channels, out_channels, h_w):
super().__init__()
mid_channels = (in_channels + out_channels) // 2
self.features = torch.nn.Sequential(
torch.nn.Conv2d(
in_channels, mid_channels, kernel_size=h_w[0] * 2, s... | x = self.features(x)
x = self.avgpool(x)
return x
| x = self.features(x)
x = self.avgpool(x)
return x
| 8 | 288 | 33 | 321 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,149 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 379,380 | 352,392 | forward | DynamicsNetwork | 380,392 | 380,392 | class DynamicsNetwork(torch.nn.Module):
def __init__(
self,
num_blocks,
num_channels,
reduced_channels_reward,
fc_reward_layers,
full_support_size,
block_output_size_reward,
):
super().__init__()
self.conv = conv3x3(num_channels, num_channe... | class DynamicsNetwork(torch.nn.Module):
def __init__(
self,
num_blocks,
num_channels,
reduced_channels_reward,
fc_reward_layers,
full_support_size,
block_output_size_reward,
):
super().__init__()
self.conv = conv3x3(num_channels, num_channe... | x = self.conv(x)
x = self.bn(x)
x = torch.nn.functional.relu(x)
for block in self.resblocks:
x = block(x)
state = x
x = self.conv1x1_reward(x)
x = x.view(-1, self.block_output_size_reward)
reward = self.fc(x)
return state, reward
| x = self.conv(x)
x = self.bn(x)
x = torch.nn.functional.relu(x)
for block in self.resblocks:
x = block(x)
state = x
x = self.conv1x1_reward(x)
x = x.view(-1, self.block_output_size_reward)
reward = self.fc(x)
return state, reward
| 32 | 307 | 127 | 434 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,150 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 172,173 | 80,206 | initial_inference | MuZeroFullyConnectedNetwork | 173,192 | 173,192 | class MuZeroFullyConnectedNetwork(AbstractNetwork):
def __init__(
self,
observation_shape,
stacked_observations,
action_space_size,
encoding_size,
fc_reward_layers,
fc_value_layers,
fc_policy_layers,
fc_representation_layers,
fc_dynamic... | class MuZeroFullyConnectedNetwork(AbstractNetwork):
def __init__(
self,
observation_shape,
stacked_observations,
action_space_size,
encoding_size,
fc_reward_layers,
fc_value_layers,
fc_policy_layers,
fc_representation_layers,
fc_dynamic... | encoded_state = self.representation(observation)
policy_logits, value = self.prediction(encoded_state)
# reward equal to 0 for consistency
reward = torch.log(
(
torch.zeros(1, self.full_support_size)
.scatter(1, torch.tensor([[self.full_support... | encoded_state = self.representation(observation)
policy_logits, value = self.prediction(encoded_state)
# reward equal to 0 for consistency
reward = torch.log(
(
torch.zeros(1, self.full_support_size)
.scatter(1, torch.tensor([[self.full_support... | 37 | 1,230 | 184 | 1,414 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,151 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 526,527 | 436,630 | representation | MuZeroResidualNetwork | 527,555 | 527,555 | class MuZeroResidualNetwork(AbstractNetwork):
def __init__(
self,
observation_shape,
stacked_observations,
action_space_size,
num_blocks,
num_channels,
reduced_channels_reward,
reduced_channels_value,
reduced_channels_policy,
fc_reward_... | class MuZeroResidualNetwork(AbstractNetwork):
def __init__(
self,
observation_shape,
stacked_observations,
action_space_size,
num_blocks,
num_channels,
reduced_channels_reward,
reduced_channels_value,
reduced_channels_policy,
fc_reward_... | encoded_state = self.representation_network(observation)
# Scale encoded state between [0, 1] (See appendix paper Training)
min_encoded_state = (
encoded_state.view(
-1,
encoded_state.shape[1],
encoded_state.shape[2] * encoded_state.sh... | encoded_state = self.representation_network(observation)
# Scale encoded state between [0, 1] (See appendix paper Training)
min_encoded_state = (
encoded_state.view(
-1,
encoded_state.shape[1],
encoded_state.shape[2] * encoded_state.sh... | 63 | 1,577 | 320 | 1,897 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,152 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 424,425 | 392,436 | forward | PredictionNetwork | 425,436 | 425,436 | class PredictionNetwork(torch.nn.Module):
def __init__(
self,
action_space_size,
num_blocks,
num_channels,
reduced_channels_value,
reduced_channels_policy,
fc_value_layers,
fc_policy_layers,
full_support_size,
block_output_size_value,
... | class PredictionNetwork(torch.nn.Module):
def __init__(
self,
action_space_size,
num_blocks,
num_channels,
reduced_channels_value,
reduced_channels_policy,
fc_value_layers,
fc_policy_layers,
full_support_size,
block_output_size_value,
... | for block in self.resblocks:
x = block(x)
value = self.conv1x1_value(x)
policy = self.conv1x1_policy(x)
value = value.view(-1, self.block_output_size_value)
policy = policy.view(-1, self.block_output_size_policy)
value = self.fc_value(value)
policy = s... | for block in self.resblocks:
x = block(x)
value = self.conv1x1_value(x)
policy = self.conv1x1_policy(x)
value = value.view(-1, self.block_output_size_value)
policy = policy.view(-1, self.block_output_size_policy)
value = self.fc_value(value)
policy = s... | 30 | 371 | 131 | 502 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,153 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 339,340 | 300,352 | forward | RepresentationNetwork | 340,352 | 340,352 | class RepresentationNetwork(torch.nn.Module):
def __init__(
self,
observation_shape,
stacked_observations,
num_blocks,
num_channels,
downsample,
):
super().__init__()
self.downsample = downsample
if self.downsample:
if self.down... | class RepresentationNetwork(torch.nn.Module):
def __init__(
self,
observation_shape,
stacked_observations,
num_blocks,
num_channels,
downsample,
):
super().__init__()
self.downsample = downsample
if self.downsample:
if self.down... | if self.downsample:
x = self.downsample_net(x)
else:
x = self.conv(x)
x = self.bn(x)
x = torch.nn.functional.relu(x)
for block in self.resblocks:
x = block(x)
return x
| if self.downsample:
x = self.downsample_net(x)
else:
x = self.conv(x)
x = self.bn(x)
x = torch.nn.functional.relu(x)
for block in self.resblocks:
x = block(x)
return x
| 24 | 403 | 99 | 502 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,154 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/models.py | 221,222 | 213,233 | forward | ResidualBlock | 222,233 | 222,233 | class ResidualBlock(torch.nn.Module):
def __init__(self, num_channels, stride=1):
super().__init__()
self.conv1 = conv3x3(num_channels, num_channels, stride)
self.bn1 = torch.nn.BatchNorm2d(num_channels)
self.conv2 = conv3x3(num_channels, num_channels)
self.bn2 = torch.nn.Bat... | class ResidualBlock(torch.nn.Module):
def __init__(self, num_channels, stride=1):
super().__init__()
self.conv1 = conv3x3(num_channels, num_channels, stride)
self.bn1 = torch.nn.BatchNorm2d(num_channels)
self.conv2 = conv3x3(num_channels, num_channels)
self.bn2 = torch.nn.Bat... | out = self.conv1(x)
out = self.bn1(out)
out = torch.nn.functional.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out += x
out = torch.nn.functional.relu(out)
return out
# Downsample observations before representation network (See paper appendix Netw... | out = self.conv1(x)
out = self.bn1(out)
out = torch.nn.functional.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out += x
out = torch.nn.functional.relu(out)
return out
# Downsample observations before representation network (See paper appendix Netw... | 34 | 150 | 116 | 266 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... |
41,155 | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general | /home/hieuvd/dung_repo/raw/stars_02/werner-duvaud_muzero-general/muzero-general/shared_storage.py | 34,35 | 7,41 | set_info | SharedStorage | 35,41 | 35,41 | @ray.remote
class SharedStorage:
"""
Class which run in a dedicated thread to store the network weights and some information.
"""
def __init__(self, checkpoint, config):
self.config = config
self.current_checkpoint = copy.deepcopy(checkpoint)
def save_checkpoint(self, path=None):
... | @ray.remote
class SharedStorage:
"""
Class which run in a dedicated thread to store the network weights and some information.
"""
def __init__(self, checkpoint, config):
self.config = config
self.current_checkpoint = copy.deepcopy(checkpoint)
def save_checkpoint(self, path=None):
... | if isinstance(keys, str) and values is not None:
self.current_checkpoint[keys] = values
elif isinstance(keys, dict):
self.current_checkpoint.update(keys)
else:
raise TypeError
| if isinstance(keys, str) and values is not None:
self.current_checkpoint[keys] = values
elif isinstance(keys, dict):
self.current_checkpoint.update(keys)
else:
raise TypeError
| 18 | 254 | 67 | 321 | import copy
import ray
import torch
@ray.remote
class SharedStorage:
"""
Class which run in a dedicated thread to store the network weights and some information.
"""
def __init__(self, checkpoint, config):
self.config = config
self.current_checkpoint = copy.deepcopy(checkpoint)
... | import copy
import ray
import torch
@ray.remote
class SharedStorage:
"""
Class which run in a dedicated thread to store the network weights and some information.
"""
def __init__(self, checkpoint, config):
self.config = config
self.current_checkpoint = copy.deepcopy(checkpoint)
... |
41,404 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/bin/make-new-etg-file.py | 129,130 | 1,140 | writeFile | 130,138 | 130,138 | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Name: bin/make-new-etg-file.py
# Author: Kevin Ollivier
#
# Created: 24-Sept-2011
# Copyright: (c) 2015-2020 by Kevin Ollivier, Robin Dunn
# License: wxWindows License
#----------------------------... | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Name: bin/make-new-etg-file.py
# Author: Kevin Ollivier
#
# Created: 24-Sept-2011
# Copyright: (c) 2015-2020 by Kevin Ollivier, Robin Dunn
# License: wxWindows License
#----------------------------... | if os.path.exists(filename):
print("'%s' already exists. Exiting." % filename)
sys.exit(1)
with open(filename, 'w') as output:
output.write(stub % values)
print("Wrote %s" % filename)
| if os.path.exists(filename):
print("'%s' already exists. Exiting." % filename)
sys.exit(1)
with open(filename, 'w') as output:
output.write(stub % values)
print("Wrote %s" % filename)
| 21 | 1,127 | 82 | 1,209 | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Name: bin/make-new-etg-file.py
# Author: Kevin Ollivier
#
# Created: 24-Sept-2011
# Copyright: (c) 2015-2020 by Kevin Ollivier, Robin Dunn
# License: wxWindows License
#----------------------------... | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Name: bin/make-new-etg-file.py
# Author: Kevin Ollivier
#
# Created: 24-Sept-2011
# Copyright: (c) 2015-2020 by Kevin Ollivier, Robin Dunn
# License: wxWindows License
#----------------------------... | |
41,405 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/bin/make-new-unittest-file.py | 51,52 | 1,65 | writeFile | 52,63 | 52,63 | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Name: bin/make-new-unittest-file.py
# Author: Robin Dunn
#
# Created: 12-July-2012
# Copyright: (c) 2013-2020 by Robin Dunn
# License: wxWindows License
#-------------------------------------------... | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Name: bin/make-new-unittest-file.py
# Author: Robin Dunn
#
# Created: 12-July-2012
# Copyright: (c) 2013-2020 by Robin Dunn
# License: wxWindows License
#-------------------------------------------... | if os.path.exists(filename):
print("'%s' already exists. Exiting." % filename)
sys.exit(1)
with open(filename, 'w') as output:
output.write(stub % values)
print("Wrote %s" % filename)
| if os.path.exists(filename):
print("'%s' already exists. Exiting." % filename)
sys.exit(1)
with open(filename, 'w') as output:
output.write(stub % values)
print("Wrote %s" % filename)
| 21 | 407 | 88 | 495 | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Name: bin/make-new-unittest-file.py
# Author: Robin Dunn
#
# Created: 12-July-2012
# Copyright: (c) 2013-2020 by Robin Dunn
# License: wxWindows License
#-------------------------------------------... | #!/usr/bin/env python
#---------------------------------------------------------------------------
# Name: bin/make-new-unittest-file.py
# Author: Robin Dunn
#
# Created: 12-July-2012
# Copyright: (c) 2013-2020 by Robin Dunn
# License: wxWindows License
#-------------------------------------------... | |
41,406 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/bin/mymd5.py | 5,6 | 1,16 | main | 6,14 | 6,14 | import sys
import glob
import hashlib
def main():
FILL_FUNC_BODYif __name__ == '__main__':
main()
| import sys
import glob
import hashlib
def main():
FILL_FUNC_BODYif __name__ == '__main__':
main()
| for arg in sys.argv[1:]:
for name in glob.glob(arg):
m = hashlib.md5()
with open(name, 'rb') as fid:
m.update(fid.read())
print('%-45s %s' % (name, m.hexdigest()))
| for arg in sys.argv[1:]:
for name in glob.glob(arg):
m = hashlib.md5()
with open(name, 'rb') as fid:
m.update(fid.read())
print('%-45s %s' % (name, m.hexdigest()))
| 22 | 40 | 91 | 131 | import sys
import glob
import hashlib
def main():
FILL_FUNC_BODYif __name__ == '__main__':
main()
| import sys
import glob
import hashlib
def main():
FILL_FUNC_BODYif __name__ == '__main__':
main()
| |
41,407 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/buildtools/backports/shutil_which.py | 13,14 | 1,79 | backport_which | 23,75 | 14,75 | """Backport of shutil.which from Python 3.5
The function is included unmodified from Python stdlib 3.5.1,
and is (C) Python
"""
from __future__ import absolute_import # Import system's os, not backports.os.
import os
import sys
__version__ = '3.5.1'
def backport_which(cmd, mode=os.F_OK | os.X_OK, path=None):
FILL_... | """Backport of shutil.which from Python 3.5
The function is included unmodified from Python stdlib 3.5.1,
and is (C) Python
"""
from __future__ import absolute_import # Import system's os, not backports.os.
import os
import sys
__version__ = '3.5.1'
def backport_which(cmd, mode=os.F_OK | os.X_OK, path=None):
"... | # Check that a given file can be accessed with the correct mode.
# Additionally check that `file` is not a directory, as on Windows
# directories pass the os.access check.
def _access_check(fn, mode):
return (os.path.exists(fn) and os.access(fn, mode)
and not os.path.isdir(fn))
... | """Given a command, mode, and a PATH string, return the path which
conforms to the given mode on the PATH, or None if there is no such
file.
`mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
of os.environ.get("PATH"), or can be overridden with a custom search
path.
"""
... | 249 | 246 | 608 | 854 | """Backport of shutil.which from Python 3.5
The function is included unmodified from Python stdlib 3.5.1,
and is (C) Python
"""
from __future__ import absolute_import # Import system's os, not backports.os.
import os
import sys
__version__ = '3.5.1'
def backport_which(cmd, mode=os.F_OK | os.X_OK, path=None):
FILL_... | """Backport of shutil.which from Python 3.5
The function is included unmodified from Python stdlib 3.5.1,
and is (C) Python
"""
from __future__ import absolute_import # Import system's os, not backports.os.
import os
import sys
__version__ = '3.5.1'
def backport_which(cmd, mode=os.F_OK | os.X_OK, path=None):
"... | |
41,408 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ActivityIndicator.py | 56,57 | 1,81 | runTest | 57,64 | 57,64 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.ai = wx.ActivityIndicator(self)
... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.ai = wx.ActivityIndicator(self)
... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 732 | 30 | 762 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.ai = wx.ActivityIndicator(self)
... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.ai = wx.ActivityIndicator(self)
... | |
41,409 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ActivityIndicator.py | 46,47 | 7,56 | OnCheckBtnStatus | TestPanel | 47,56 | 47,56 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.ai = wx.ActivityIndicator(self)
self.ai.Start()
startBtn = wx.Button(self, label='Start')
stopBtn = wx.Button(self, labe... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.ai = wx.ActivityIndicator(self)
self.ai.Start()
startBtn = wx.Button(self, label='Start')
stopBtn = wx.Button(self, labe... | obj = evt.GetEventObject()
running = self.ai.IsRunning()
if obj.Label == 'Start':
evt.Enable(not running)
if obj.Label == 'Stop':
evt.Enable(running)
#----------------------------------------------------------------------
| obj = evt.GetEventObject()
running = self.ai.IsRunning()
if obj.Label == 'Start':
evt.Enable(not running)
if obj.Label == 'Stop':
evt.Enable(running)
#----------------------------------------------------------------------
| 18 | 497 | 76 | 573 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.ai = wx.ActivityIndicator(self)
... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.ai = wx.ActivityIndicator(self)
... |
41,410 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/AddPrivateFont.py | 67,68 | 1,111 | runTest | 68,75 | 68,75 | #!/usr/bin/env python
import os
import sys
try:
gFileDir = os.path.dirname(os.path.abspath(__file__))
except:
gFileDir = os.path.dirname(os.path.abspath(sys.argv[0]))
gDataDir = os.path.join(gFileDir, 'data')
import wx
FILENAME = 'SourceCodePro-Regular.ttf'
SAMPLETEXT = """
SourceCodePro-Regular.ttf
Lore... | #!/usr/bin/env python
import os
import sys
try:
gFileDir = os.path.dirname(os.path.abspath(__file__))
except:
gFileDir = os.path.dirname(os.path.abspath(sys.argv[0]))
gDataDir = os.path.join(gFileDir, 'data')
import wx
FILENAME = 'SourceCodePro-Regular.ttf'
SAMPLETEXT = """
SourceCodePro-Regular.ttf
Lore... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 1,083 | 30 | 1,113 | #!/usr/bin/env python
import os
import sys
try:
gFileDir = os.path.dirname(os.path.abspath(__file__))
except:
gFileDir = os.path.dirname(os.path.abspath(sys.argv[0]))
gDataDir = os.path.join(gFileDir, 'data')
import wx
FILENAME = 'SourceCodePro-Regular.ttf'
SAMPLETEXT = """
SourceCodePro-Regular.ttf
Lore... | #!/usr/bin/env python
import os
import sys
try:
gFileDir = os.path.dirname(os.path.abspath(__file__))
except:
gFileDir = os.path.dirname(os.path.abspath(sys.argv[0]))
gDataDir = os.path.join(gFileDir, 'data')
import wx
FILENAME = 'SourceCodePro-Regular.ttf'
SAMPLETEXT = """
SourceCodePro-Regular.ttf
Lore... | |
41,412 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/AdjustChannels.py | 106,107 | 70,135 | OnPaint | ImageWindow | 107,126 | 107,126 | class ImageWindow(wx.Window):
def __init__(self, parent):
wx.Window.__init__(self, parent)
self.image1= wx.Image(opj('bitmaps/image.bmp'), wx.BITMAP_TYPE_BMP)
self.image2= wx.Image(opj('bitmaps/toucan.png'), wx.BITMAP_TYPE_PNG)
# the factors -- 1.0 does not not modify the image
... | class ImageWindow(wx.Window):
def __init__(self, parent):
wx.Window.__init__(self, parent)
self.image1= wx.Image(opj('bitmaps/image.bmp'), wx.BITMAP_TYPE_BMP)
self.image2= wx.Image(opj('bitmaps/toucan.png'), wx.BITMAP_TYPE_PNG)
# the factors -- 1.0 does not not modify the image
... | dc= wx.PaintDC(self)
dc= wx.BufferedDC(dc)
# paint a background to show the alpha manipulation
dc.SetBackground(wx.Brush("WHITE"))
dc.Clear()
dc.SetBrush(wx.Brush("GREY", wx.BRUSHSTYLE_CROSSDIAG_HATCH))
windowsize= self.GetSize()
dc.DrawRectangle(0, 0, wi... | dc= wx.PaintDC(self)
dc= wx.BufferedDC(dc)
# paint a background to show the alpha manipulation
dc.SetBackground(wx.Brush("WHITE"))
dc.Clear()
dc.SetBrush(wx.Brush("GREY", wx.BRUSHSTYLE_CROSSDIAG_HATCH))
windowsize= self.GetSize()
dc.DrawRectangle(0, 0, wi... | 54 | 485 | 311 | 796 | #!/usr/bin/env python
import wx
from Main import opj
#----------------------------------------------------------------------
# AdjustChannels demo. The interesting part is ImageWindow.OnPaint
class TestAdjustChannels(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(s... | #!/usr/bin/env python
import wx
from Main import opj
#----------------------------------------------------------------------
# AdjustChannels demo. The interesting part is ImageWindow.OnPaint
class TestAdjustChannels(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(s... |
41,413 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/AlphaDrawing.py | 49,50 | 1,78 | runTest | 50,57 | 50,57 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = """\
If this build of... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = """\
If this build of... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 808 | 30 | 838 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = """\
If this build of... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = """\
If this build of... | |
41,414 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/AlphaDrawing.py | 21,22 | 7,49 | OnPaint | TestPanel | 22,49 | 22,49 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = """\
If this build of wxPython includes the new wx.GCDC class (which
provides the wx.DC API on top of the new wx.GraphicsContext... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = """\
If this build of wxPython includes the new wx.GCDC class (which
provides the wx.DC API on top of the new wx.GraphicsContext... | pdc = wx.PaintDC(self)
try:
dc = wx.GCDC(pdc)
except:
dc = pdc
rect = wx.Rect(0,0, 100, 100)
for RGB, pos in [((178, 34, 34), ( 50, 90)),
(( 35, 142, 35), (110, 150)),
(( 0, 0, 139), (170, 90))
... | pdc = wx.PaintDC(self)
try:
dc = wx.GCDC(pdc)
except:
dc = pdc
rect = wx.Rect(0,0, 100, 100)
for RGB, pos in [((178, 34, 34), ( 50, 90)),
(( 35, 142, 35), (110, 150)),
(( 0, 0, 139), (170, 90))
... | 85 | 163 | 429 | 592 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = """\
If this build of... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = """\
If this build of... |
41,415 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/AnalogClock.py | 125,126 | 1,145 | runTest | 126,133 | 126,133 | #!/usr/bin/env python
# AnalogClock demo
# E. A. Tacao <e.a.tacao |at| estadao.com.br>
# http://j.domaindlx.com/elements28/wxpython/
# 12 Fev 2006, 22:00 GMT-03:00
# Distributed under the wxWidgets license.
import wx
import wx.lib.analogclock as ac
#-------------------------------------------------------------... | #!/usr/bin/env python
# AnalogClock demo
# E. A. Tacao <e.a.tacao |at| estadao.com.br>
# http://j.domaindlx.com/elements28/wxpython/
# 12 Fev 2006, 22:00 GMT-03:00
# Distributed under the wxWidgets license.
import wx
import wx.lib.analogclock as ac
#-------------------------------------------------------------... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 1,940 | 30 | 1,970 | #!/usr/bin/env python
# AnalogClock demo
# E. A. Tacao <e.a.tacao |at| estadao.com.br>
# http://j.domaindlx.com/elements28/wxpython/
# 12 Fev 2006, 22:00 GMT-03:00
# Distributed under the wxWidgets license.
import wx
import wx.lib.analogclock as ac
#-------------------------------------------------------------... | #!/usr/bin/env python
# AnalogClock demo
# E. A. Tacao <e.a.tacao |at| estadao.com.br>
# http://j.domaindlx.com/elements28/wxpython/
# 12 Fev 2006, 22:00 GMT-03:00
# Distributed under the wxWidgets license.
import wx
import wx.lib.analogclock as ac
#-------------------------------------------------------------... | |
41,417 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ArtProvider.py | 84,85 | 79,125 | CreateBitmap | MyArtProvider | 85,125 | 85,125 | class MyArtProvider(wx.ArtProvider):
def __init__(self, log):
wx.ArtProvider.__init__(self)
self.log = log
def CreateBitmap(self, artid, client, size):
FILL_FUNC_BODY | class MyArtProvider(wx.ArtProvider):
def __init__(self, log):
wx.ArtProvider.__init__(self)
self.log = log
def CreateBitmap(self, artid, client, size):
FILL_FUNC_BODY | # You can do anything here you want, such as using the same
# image for any size, any client, etc., or using specific
# images for specific sizes, whatever...
# See end of file for the image data
bmp = wx.NullBitmap
# use this one for all 48x48 images
if size.wi... | # You can do anything here you want, such as using the same
# image for any size, any client, etc., or using specific
# images for specific sizes, whatever...
# See end of file for the image data
bmp = wx.NullBitmap
# use this one for all 48x48 images
if size.wi... | 155 | 66 | 500 | 566 | #!/usr/bin/env python
# Tags: phoenix-port, py3-port
from six import BytesIO
import wx
#----------------------------------------------------------------------
ArtClients = [ "wx.ART_TOOLBAR",
"wx.ART_MENU",
"wx.ART_FRAME_ICON",
"wx.ART_CMN_DIALOG",
"wx.AR... | #!/usr/bin/env python
# Tags: phoenix-port, py3-port
from six import BytesIO
import wx
#----------------------------------------------------------------------
ArtClients = [ "wx.ART_TOOLBAR",
"wx.ART_MENU",
"wx.ART_FRAME_ICON",
"wx.ART_CMN_DIALOG",
"wx.AR... |
41,418 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ArtProvider.py | 217,218 | 125,254 | getArt | TestPanel | 218,245 | 218,245 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sizer = wx.BoxSizer(wx.VERTICAL)
title = wx.StaticText(self, -1, "ArtProvider")
title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_B... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sizer = wx.BoxSizer(wx.VERTICAL)
title = wx.StaticText(self, -1, "ArtProvider")
title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_B... | self.log.write("Getting art for %s:%s\n" % (self.client, self.artid))
bmp = wx.ArtProvider.GetBitmap(self.artid, self.client, (16,16))
if not bmp.IsOk():
bmp = wx.Bitmap(16,16)
self.clearBmp(bmp)
self.bmp16.SetBitmap(bmp)
bmp = wx.ArtProvider.GetBitmap... | self.log.write("Getting art for %s:%s\n" % (self.client, self.artid))
bmp = wx.ArtProvider.GetBitmap(self.artid, self.client, (16,16))
if not bmp.IsOk():
bmp = wx.Bitmap(16,16)
self.clearBmp(bmp)
self.bmp16.SetBitmap(bmp)
bmp = wx.ArtProvider.GetBitmap... | 46 | 1,476 | 318 | 1,794 | #!/usr/bin/env python
# Tags: phoenix-port, py3-port
from six import BytesIO
import wx
#----------------------------------------------------------------------
ArtClients = [ "wx.ART_TOOLBAR",
"wx.ART_MENU",
"wx.ART_FRAME_ICON",
"wx.ART_CMN_DIALOG",
"wx.AR... | #!/usr/bin/env python
# Tags: phoenix-port, py3-port
from six import BytesIO
import wx
#----------------------------------------------------------------------
ArtClients = [ "wx.ART_TOOLBAR",
"wx.ART_MENU",
"wx.ART_FRAME_ICON",
"wx.ART_CMN_DIALOG",
"wx.AR... |
41,419 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/BitmapButton.py | 61,62 | 1,88 | runTest | 62,68 | 62,68 | #!/usr/bin/env python
import wx
import images
#import wx.lib.buttons
#wx.BitmapButton = wx.lib.buttons.GenBitmapButton
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
... | #!/usr/bin/env python
import wx
import images
#import wx.lib.buttons
#wx.BitmapButton = wx.lib.buttons.GenBitmapButton
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 937 | 28 | 965 | #!/usr/bin/env python
import wx
import images
#import wx.lib.buttons
#wx.BitmapButton = wx.lib.buttons.GenBitmapButton
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
... | #!/usr/bin/env python
import wx
import images
#import wx.lib.buttons
#wx.BitmapButton = wx.lib.buttons.GenBitmapButton
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
... | |
41,420 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/BitmapButton.py | 55,56 | 11,61 | OnClick | TestPanel | 56,61 | 56,61 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
if 0: # a test case for catching wx.PyAssertionError
#wx.GetApp().SetAssertMode(wx.PYAPP_ASSERT_SUPPRESS)... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
if 0: # a test case for catching wx.PyAssertionError
#wx.GetApp().SetAssertMode(wx.PYAPP_ASSERT_SUPPRESS)... | self.log.write("Click! (%d)\n" % event.GetId())
#----------------------------------------------------------------------
| self.log.write("Click! (%d)\n" % event.GetId())
#----------------------------------------------------------------------
| 5 | 658 | 34 | 692 | #!/usr/bin/env python
import wx
import images
#import wx.lib.buttons
#wx.BitmapButton = wx.lib.buttons.GenBitmapButton
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
... | #!/usr/bin/env python
import wx
import images
#import wx.lib.buttons
#wx.BitmapButton = wx.lib.buttons.GenBitmapButton
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
... |
41,421 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/BitmapFromBuffer.py | 104,105 | 1,141 | runTest | 105,112 | 105,112 | #!/usr/bin/env python
import wx
import array
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.width, sel... | #!/usr/bin/env python
import wx
import array
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.width, sel... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 1,491 | 30 | 1,521 | #!/usr/bin/env python
import wx
import array
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.width, sel... | #!/usr/bin/env python
import wx
import array
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.width, sel... | |
41,422 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/BitmapFromBuffer.py | 32,33 | 8,104 | MakeBitmapRGB | TestPanel | 33,47 | 33,47 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.width, self.height = 120,120
self.MakeBitmapRGB(self.width, self.height)
self.MakeBitmapRGBA(self.width, self.hei... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.width, self.height = 120,120
self.MakeBitmapRGB(self.width, self.height)
self.MakeBitmapRGBA(self.width, self.hei... | # Make a bitmap using an array of RGB bytes
bpp = 3 # bytes per pixel
bytes = array.array('B', [0] * width*height*bpp)
for y in range(height):
for x in range(width):
offset = y*width*bpp + x*bpp
r,g,b = self.GetRGB(x, y, bpp)
... | # Make a bitmap using an array of RGB bytes
bpp = 3 # bytes per pixel
bytes = array.array('B', [0] * width*height*bpp)
for y in range(height):
for x in range(width):
offset = y*width*bpp + x*bpp
r,g,b = self.GetRGB(x, y, bpp)
... | 61 | 1,035 | 169 | 1,204 | #!/usr/bin/env python
import wx
import array
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.width, sel... | #!/usr/bin/env python
import wx
import array
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.width, sel... |
41,423 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Button.py | 55,56 | 1,78 | runTest | 56,62 | 56,62 | #!/usr/bin/env python
import wx
import images
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
... | #!/usr/bin/env python
import wx
import images
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 816 | 28 | 844 | #!/usr/bin/env python
import wx
import images
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
... | #!/usr/bin/env python
import wx
import images
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
... | |
41,424 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Button.py | 50,51 | 8,55 | OnClick | TestPanel | 51,55 | 51,55 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
b = wx.Button(self, 10, "Default Button", (20, 20))
self.Bind(wx.EVT_BUTTON, self.OnClick, b)
b.SetDefa... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
b = wx.Button(self, 10, "Default Button", (20, 20))
self.Bind(wx.EVT_BUTTON, self.OnClick, b)
b.SetDefa... | self.log.write("Click! (%d)\n" % event.GetId())
#----------------------------------------------------------------------
| self.log.write("Click! (%d)\n" % event.GetId())
#----------------------------------------------------------------------
| 5 | 640 | 32 | 672 | #!/usr/bin/env python
import wx
import images
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
... | #!/usr/bin/env python
import wx
import images
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1,
style=wx.NO_FULL_REPAINT_ON_RESIZE)
self.log = log
... |
41,425 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Cairo.py | 126,127 | 18,155 | warpPath | TestPanel | 127,155 | 127,155 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, evt):
if self.IsDoubleBuffered():
dc = wx.PaintDC(self)
else:
dc = wx.Buffered... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, evt):
if self.IsDoubleBuffered():
dc = wx.PaintDC(self)
else:
dc = wx.Buffered... | def f(x, y):
xn = x - tw/2
yn = y+ xn ** 3 / ((tw/2)**3) * 70
return xn+dx, yn+dy
path = ctx.copy_path()
ctx.new_path()
for type, points in path:
if type == cairo.PATH_MOVE_TO:
x, y = f(*points)
ctx.move_to(... | def f(x, y):
xn = x - tw/2
yn = y+ xn ** 3 / ((tw/2)**3) * 70
return xn+dx, yn+dy
path = ctx.copy_path()
ctx.new_path()
for type, points in path:
if type == cairo.PATH_MOVE_TO:
x, y = f(*points)
ctx.move_to(... | 89 | 1,392 | 329 | 1,721 | #!/usr/bin/env python
import wx
import math
try:
import wx.lib.wxcairo as wxcairo
import cairo
haveCairo = True
except ImportError:
haveCairo = False
from Main import opj
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, paren... | #!/usr/bin/env python
import wx
import math
try:
import wx.lib.wxcairo as wxcairo
import cairo
haveCairo = True
except ImportError:
haveCairo = False
from Main import opj
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, paren... |
41,426 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Cairo_Snippets.py | 27,28 | 20,42 | OnPaint | DisplayPanel | 28,36 | 28,36 | class DisplayPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, style=wx.BORDER_SIMPLE)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.curr_snippet = ''
def OnPaint(self, evt):
FILL_FUNC_BODY def SetSnippet(self, text):
self.curr_snippet = text
... | class DisplayPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, style=wx.BORDER_SIMPLE)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.curr_snippet = ''
def OnPaint(self, evt):
FILL_FUNC_BODY def SetSnippet(self, text):
self.curr_snippet = text
... | dc = wx.PaintDC(self)
if self.curr_snippet:
width, height = self.GetClientSize()
cr = wx.lib.wxcairo.ContextFromDC(dc)
exec(self.curr_snippet, globals(), locals())
| dc = wx.PaintDC(self)
if self.curr_snippet:
width, height = self.GetClientSize()
cr = wx.lib.wxcairo.ContextFromDC(dc)
exec(self.curr_snippet, globals(), locals())
| 15 | 132 | 84 | 216 | #!/usr/bin/env python
import wx
try:
import wx.lib.wxcairo
import cairo
haveCairo = True
except ImportError:
haveCairo = False
from math import pi as M_PI # used by many snippets
from snippets import snip_list, snippet_normalize
from Main import opj, DemoCodeEditor
#--------------------------------... | #!/usr/bin/env python
import wx
try:
import wx.lib.wxcairo
import cairo
haveCairo = True
except ImportError:
haveCairo = False
from math import pi as M_PI # used by many snippets
from snippets import snip_list, snippet_normalize
from Main import opj, DemoCodeEditor
#--------------------------------... |
41,427 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Cairo_Snippets.py | 67,68 | 42,77 | OnListBoxSelect | TestPanel | 68,77 | 68,77 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.lb = wx.ListBox(self, choices=snip_list)
self.canvas = DisplayPanel(self)
self.editor = DemoCodeEditor(self, style=wx.BORDER_SIMPLE)
self.editor.SetEdi... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.lb = wx.ListBox(self, choices=snip_list)
self.canvas = DisplayPanel(self)
self.editor = DemoCodeEditor(self, style=wx.BORDER_SIMPLE)
self.editor.SetEdi... | snippet_file = opj('snippets/%s.py' % evt.GetString())
with open(snippet_file) as f:
text = f.read()
self.canvas.SetSnippet(text)
self.editor.SetValue(text)
#----------------------------------------------------------------------
| snippet_file = opj('snippets/%s.py' % evt.GetString())
with open(snippet_file) as f:
text = f.read()
self.canvas.SetSnippet(text)
self.editor.SetValue(text)
#----------------------------------------------------------------------
| 15 | 350 | 89 | 439 | #!/usr/bin/env python
import wx
try:
import wx.lib.wxcairo
import cairo
haveCairo = True
except ImportError:
haveCairo = False
from math import pi as M_PI # used by many snippets
from snippets import snip_list, snippet_normalize
from Main import opj, DemoCodeEditor
#--------------------------------... | #!/usr/bin/env python
import wx
try:
import wx.lib.wxcairo
import cairo
haveCairo = True
except ImportError:
haveCairo = False
from math import pi as M_PI # used by many snippets
from snippets import snip_list, snippet_normalize
from Main import opj, DemoCodeEditor
#--------------------------------... |
41,428 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CheckBox.py | 55,56 | 1,75 | runTest | 56,62 | 56,62 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestCheckBox(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
st = wx.StaticText(self, -1, "This example demonstrates the wx.Ch... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestCheckBox(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
st = wx.StaticText(self, -1, "This example demonstrates the wx.Ch... | win = TestCheckBox(nb, log)
return win
#---------------------------------------------------------------------------
| win = TestCheckBox(nb, log)
return win
#---------------------------------------------------------------------------
| 7 | 799 | 29 | 828 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestCheckBox(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
st = wx.StaticText(self, -1, "This example demonstrates the wx.Ch... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestCheckBox(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
st = wx.StaticText(self, -1, "This example demonstrates the wx.Ch... | |
41,429 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CheckBox.py | 46,47 | 7,55 | EvtCheckBox | TestCheckBox | 47,55 | 47,55 | class TestCheckBox(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
st = wx.StaticText(self, -1, "This example demonstrates the wx.CheckBox control.")#, (10, 10))
cb1 = wx.CheckBox(self, -1, "Apples")#, (65, 40), (150, 20), wx.NO_BORDER... | class TestCheckBox(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
st = wx.StaticText(self, -1, "This example demonstrates the wx.CheckBox control.")#, (10, 10))
cb1 = wx.CheckBox(self, -1, "Apples")#, (65, 40), (150, 20), wx.NO_BORDER... | self.log.write('EvtCheckBox: %d\n' % event.IsChecked())
cb = event.GetEventObject()
if cb.Is3State():
self.log.write("\t3StateValue: %s\n" % cb.Get3StateValue())
#---------------------------------------------------------------------------
| self.log.write('EvtCheckBox: %d\n' % event.IsChecked())
cb = event.GetEventObject()
if cb.Is3State():
self.log.write("\t3StateValue: %s\n" % cb.Get3StateValue())
#---------------------------------------------------------------------------
| 14 | 598 | 85 | 683 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestCheckBox(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
st = wx.StaticText(self, -1, "This example demonstrates the wx.Ch... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestCheckBox(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
st = wx.StaticText(self, -1, "This example demonstrates the wx.Ch... |
41,430 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CheckListBox.py | 56,57 | 1,80 | runTest | 57,63 | 57,63 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 791 | 28 | 819 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | |
41,431 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CheckListBox.py | 37,38 | 7,56 | EvtCheckListBox | TestPanel | 38,47 | 38,47 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight', 'nine', 'ten', 'eleven',
'twelve', 'thirteen', 'fo... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight', 'nine', 'ten', 'eleven',
'twelve', 'thirteen', 'fo... | index = event.GetSelection()
label = self.lb.GetString(index)
status = 'un'
if self.lb.IsChecked(index):
status = ''
self.log.WriteText('Box %s is %schecked \n' % (label, status))
self.lb.SetSelection(index) # so that (un)checking also selects (moves the hi... | index = event.GetSelection()
label = self.lb.GetString(index)
status = 'un'
if self.lb.IsChecked(index):
status = ''
self.log.WriteText('Box %s is %schecked \n' % (label, status))
self.lb.SetSelection(index) # so that (un)checking also selects (moves the hi... | 32 | 514 | 111 | 625 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... |
41,432 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CheckListCtrl.py | 76,77 | 1,100 | runTest | 77,84 | 77,84 | #!/usr/bin/env python
import sys
import wx
from ListCtrl import musicdata
#----------------------------------------------------------------------
class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
... | #!/usr/bin/env python
import sys
import wx
from ListCtrl import musicdata
#----------------------------------------------------------------------
class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 971 | 30 | 1,001 | #!/usr/bin/env python
import sys
import wx
from ListCtrl import musicdata
#----------------------------------------------------------------------
class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
... | #!/usr/bin/env python
import sys
import wx
from ListCtrl import musicdata
#----------------------------------------------------------------------
class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
... | |
41,433 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CheckListCtrl.py | 27,28 | 10,36 | OnItemCheckChanged | CheckListCtrl | 28,36 | 28,36 | class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
self.EnableCheckBoxes()
self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
self.Bind(wx.EVT_LIST_ITEM_CHECKED, self.OnItemChe... | class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
self.EnableCheckBoxes()
self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
self.Bind(wx.EVT_LIST_ITEM_CHECKED, self.OnItemChe... | index = evt.Index
data = self.GetItemData(index)
title = musicdata[data][1]
what = "checked" if self.IsItemChecked(index) else "unchecked"
self.log.write('item "%s", at index %d was %s\n' % (title, index, what))
| index = evt.Index
data = self.GetItemData(index)
title = musicdata[data][1]
what = "checked" if self.IsItemChecked(index) else "unchecked"
self.log.write('item "%s", at index %d was %s\n' % (title, index, what))
| 27 | 233 | 94 | 327 | #!/usr/bin/env python
import sys
import wx
from ListCtrl import musicdata
#----------------------------------------------------------------------
class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
... | #!/usr/bin/env python
import sys
import wx
from ListCtrl import musicdata
#----------------------------------------------------------------------
class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
... |
41,434 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CheckListCtrl.py | 67,68 | 36,76 | OnItemSelected | TestPanel | 68,70 | 68,70 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.list = CheckListCtrl(self, log)
sizer = wx.BoxSizer()
sizer.Add(self.list, 1, wx.EXPAND)
self.SetSizer(sizer)
self.list.InsertColumn(0, "Artis... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.list = CheckListCtrl(self, log)
sizer = wx.BoxSizer()
sizer.Add(self.list, 1, wx.EXPAND)
self.SetSizer(sizer)
self.list.InsertColumn(0, "Artis... | self.log.write('item selected: %s\n' % evt.Index)
| self.log.write('item selected: %s\n' % evt.Index)
| 5 | 460 | 25 | 485 | #!/usr/bin/env python
import sys
import wx
from ListCtrl import musicdata
#----------------------------------------------------------------------
class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
... | #!/usr/bin/env python
import sys
import wx
from ListCtrl import musicdata
#----------------------------------------------------------------------
class CheckListCtrl(wx.ListCtrl):
def __init__(self, parent, log):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
self.log = log
... |
41,435 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Choice.py | 31,32 | 1,56 | runTest | 32,37 | 32,37 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestChoice(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestChoice(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | win = TestChoice(nb, log)
return win
#---------------------------------------------------------------------------
| win = TestChoice(nb, log)
return win
#---------------------------------------------------------------------------
| 7 | 496 | 27 | 523 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestChoice(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestChoice(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | |
41,436 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Choice.py | 21,22 | 7,31 | EvtChoice | TestChoice | 22,31 | 22,31 | class TestChoice(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight']
wx.StaticText(self, -1, "This example uses the wxChoice contro... | class TestChoice(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight']
wx.StaticText(self, -1, "This example uses the wxChoice contro... | self.log.WriteText('EvtChoice: %s\n' % event.GetString())
self.ch.Append("A new item")
if event.GetString() == 'one':
self.log.WriteText('Well done!\n')
#---------------------------------------------------------------------------
| self.log.WriteText('EvtChoice: %s\n' % event.GetString())
self.ch.Append("A new item")
if event.GetString() == 'one':
self.log.WriteText('Well done!\n')
#---------------------------------------------------------------------------
| 14 | 223 | 80 | 303 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestChoice(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestChoice(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
... |
41,437 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Choicebook.py | 55,56 | 1,81 | runTest | 56,62 | 56,62 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------------
pageTexts = [ "Yet",
"Another",
"Way",
"To",
"Select",
"Pages"
]
class TestCB(wx.Choicebook):
def __init__(self, pare... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------------
pageTexts = [ "Yet",
"Another",
"Way",
"To",
"Select",
"Pages"
]
class TestCB(wx.Choicebook):
def __init__(self, pare... | testWin = TestCB(nb, -1, log)
return testWin
#----------------------------------------------------------------------------
| testWin = TestCB(nb, -1, log)
return testWin
#----------------------------------------------------------------------------
| 8 | 627 | 33 | 660 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------------
pageTexts = [ "Yet",
"Another",
"Way",
"To",
"Select",
"Pages"
]
class TestCB(wx.Choicebook):
def __init__(self, pare... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------------
pageTexts = [ "Yet",
"Another",
"Way",
"To",
"Select",
"Pages"
]
class TestCB(wx.Choicebook):
def __init__(self, pare... | |
41,438 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Choicebook.py | 39,40 | 16,55 | OnPageChanged | TestCB | 40,46 | 40,46 | class TestCB(wx.Choicebook):
def __init__(self, parent, id, log):
wx.Choicebook.__init__(self, parent, id)
self.log = log
# Now make a bunch of panels for the choice book
count = 1
for txt in pageTexts:
win = wx.Panel(self)
if count == 1:
... | class TestCB(wx.Choicebook):
def __init__(self, parent, id, log):
wx.Choicebook.__init__(self, parent, id)
self.log = log
# Now make a bunch of panels for the choice book
count = 1
for txt in pageTexts:
win = wx.Panel(self)
if count == 1:
... | old = event.GetOldSelection()
new = event.GetSelection()
sel = self.GetSelection()
self.log.write('OnPageChanged, old:%d, new:%d, sel:%d\n' % (old, new, sel))
event.Skip()
| old = event.GetOldSelection()
new = event.GetSelection()
sel = self.GetSelection()
self.log.write('OnPageChanged, old:%d, new:%d, sel:%d\n' % (old, new, sel))
event.Skip()
| 18 | 363 | 79 | 442 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------------
pageTexts = [ "Yet",
"Another",
"Way",
"To",
"Select",
"Pages"
]
class TestCB(wx.Choicebook):
def __init__(self, pare... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------------
pageTexts = [ "Yet",
"Another",
"Way",
"To",
"Select",
"Pages"
]
class TestCB(wx.Choicebook):
def __init__(self, pare... |
41,439 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CollapsibleHeaderCtrl.py | 58,59 | 1,86 | runTest | 59,66 | 59,66 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.chc = wx.CollapsibleHeaderCtrl(self, ... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.chc = wx.CollapsibleHeaderCtrl(self, ... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 881 | 30 | 911 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.chc = wx.CollapsibleHeaderCtrl(self, ... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.chc = wx.CollapsibleHeaderCtrl(self, ... | |
41,440 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CollapsibleHeaderCtrl.py | 44,45 | 7,58 | OnCheckBtnStatus | TestPanel | 45,52 | 45,52 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.chc = wx.CollapsibleHeaderCtrl(self, label='the label')
setBtn = wx.Button(self, label='Set Collapsed')
unsetBtn = wx.Button(sel... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.chc = wx.CollapsibleHeaderCtrl(self, label='the label')
setBtn = wx.Button(self, label='Set Collapsed')
unsetBtn = wx.Button(sel... | obj = evt.GetEventObject()
collapsed = self.chc.IsCollapsed()
if obj.Label.startswith('Set'):
evt.Enable(not collapsed)
if obj.Label.startswith('Unset'):
evt.Enable(collapsed)
| obj = evt.GetEventObject()
collapsed = self.chc.IsCollapsed()
if obj.Label.startswith('Set'):
evt.Enable(not collapsed)
if obj.Label.startswith('Unset'):
evt.Enable(collapsed)
| 13 | 603 | 83 | 686 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.chc = wx.CollapsibleHeaderCtrl(self, ... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create some controls
self.chc = wx.CollapsibleHeaderCtrl(self, ... |
41,441 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CollapsiblePane.py | 102,103 | 1,127 | runTest | 103,110 | 103,110 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
label1 = "Click here to show pane"
label2 = "Click here to hide pane"
btnlbl1 = "call Expand(True)"
btnlbl2 = "call Expand(False)"
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.lo... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
label1 = "Click here to show pane"
label2 = "Click here to hide pane"
btnlbl1 = "call Expand(True)"
btnlbl2 = "call Expand(False)"
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.lo... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 1,402 | 30 | 1,432 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
label1 = "Click here to show pane"
label2 = "Click here to hide pane"
btnlbl1 = "call Expand(True)"
btnlbl2 = "call Expand(False)"
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.lo... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
label1 = "Click here to show pane"
label2 = "Click here to hide pane"
btnlbl1 = "call Expand(True)"
btnlbl2 = "call Expand(False)"
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.lo... | |
41,442 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CollapsiblePane.py | 60,61 | 14,102 | MakePaneContent | TestPanel | 62,102 | 61,102 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
title = wx.StaticText(self, label="wx.CollapsiblePane")
title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))
title.SetForeground... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
title = wx.StaticText(self, label="wx.CollapsiblePane")
title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))
title.SetForeground... | nameLbl = wx.StaticText(pane, -1, "Name:")
name = wx.TextCtrl(pane, -1, "");
addrLbl = wx.StaticText(pane, -1, "Address:")
addr1 = wx.TextCtrl(pane, -1, "");
addr2 = wx.TextCtrl(pane, -1, "");
cstLbl = wx.StaticText(pane, -1, "City, State, Zip:")
city = wx.Text... | '''Just make a few controls to put on the collapsible pane'''
nameLbl = wx.StaticText(pane, -1, "Name:")
name = wx.TextCtrl(pane, -1, "");
addrLbl = wx.StaticText(pane, -1, "Address:")
addr1 = wx.TextCtrl(pane, -1, "");
addr2 = wx.TextCtrl(pane, -1, "");
cstLbl ... | 97 | 605 | 620 | 1,225 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
label1 = "Click here to show pane"
label2 = "Click here to hide pane"
btnlbl1 = "call Expand(True)"
btnlbl2 = "call Expand(False)"
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.lo... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
label1 = "Click here to show pane"
label2 = "Click here to hide pane"
btnlbl1 = "call Expand(True)"
btnlbl2 = "call Expand(False)"
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.lo... |
41,444 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ColourDB.py | 146,147 | 139,154 | OnSize | TestPanel | 147,154 | 147,154 | class TestPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
self.win = TestWindow(self)
self.Bind(wx.EVT_SIZE, self.OnSize)
def OnSize(self, evt):
FILL_FUNC_BODY | class TestPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
self.win = TestWindow(self)
self.Bind(wx.EVT_SIZE, self.OnSize)
def OnSize(self, evt):
FILL_FUNC_BODY | self.win.SetSize(evt.GetSize())
#----------------------------------------------------------------------
| self.win.SetSize(evt.GetSize())
#----------------------------------------------------------------------
| 2 | 86 | 31 | 117 | #!/usr/bin/env python
import wx
import wx.lib.colourdb
import images
#----------------------------------------------------------------------
class TestWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, -1)
# Populate our color list
self.clrL... | #!/usr/bin/env python
import wx
import wx.lib.colourdb
import images
#----------------------------------------------------------------------
class TestWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, -1)
# Populate our color list
self.clrL... |
41,445 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ColourDB.py | 99,100 | 11,139 | Draw | TestWindow | 100,139 | 100,139 | class TestWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, -1)
# Populate our color list
self.clrList = wx.lib.colourdb.getColourInfoList()
# Just for style points, we'll use this as a background image.
self.bg_bmp = images.Gri... | class TestWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, -1)
# Populate our color list
self.clrList = wx.lib.colourdb.getColourInfoList()
# Just for style points, we'll use this as a background image.
self.bg_bmp = images.Gri... | dc.SetTextForeground("BLACK")
dc.SetPen(wx.Pen("BLACK", 1, wx.PENSTYLE_SOLID))
dc.SetFont(self.font)
colours = self.clrList
numColours = len(colours)
if rgn:
# determine the subset of the color list that has been exposed
# and needs drawn. This is... | dc.SetTextForeground("BLACK")
dc.SetPen(wx.Pen("BLACK", 1, wx.PENSTYLE_SOLID))
dc.SetFont(self.font)
colours = self.clrList
numColours = len(colours)
if rgn:
# determine the subset of the color list that has been exposed
# and needs drawn. This is... | 146 | 961 | 514 | 1,475 | #!/usr/bin/env python
import wx
import wx.lib.colourdb
import images
#----------------------------------------------------------------------
class TestWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, -1)
# Populate our color list
self.clrL... | #!/usr/bin/env python
import wx
import wx.lib.colourdb
import images
#----------------------------------------------------------------------
class TestWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, -1)
# Populate our color list
self.clrL... |
41,446 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ColourDialog.py | 43,44 | 1,77 | runTest | 44,51 | 44,51 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ColourDialog", (50,50))
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ColourDialog", (50,50))
... | win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
| 7 | 696 | 30 | 726 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ColourDialog", (50,50))
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ColourDialog", (50,50))
... | |
41,447 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ColourDialog.py | 16,17 | 7,43 | OnButton | TestPanel | 17,43 | 17,43 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ColourDialog", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)
def OnButton(self, evt):
FILL_FUNC_BODY | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ColourDialog", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)
def OnButton(self, evt):
FILL_FUNC_BODY | dlg = wx.ColourDialog(self)
# Ensure the full colour dialog is displayed,
# not the abbreviated version.
dlg.GetColourData().SetChooseFull(True)
if dlg.ShowModal() == wx.ID_OK:
# If the user selected OK, then the dialog's wx.ColourData will
# contain va... | dlg = wx.ColourDialog(self)
# Ensure the full colour dialog is displayed,
# not the abbreviated version.
dlg.GetColourData().SetChooseFull(True)
if dlg.ShowModal() == wx.ID_OK:
# If the user selected OK, then the dialog's wx.ColourData will
# contain va... | 98 | 118 | 278 | 396 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ColourDialog", (50,50))
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ColourDialog", (50,50))
... |
41,448 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ColourSelect.py | 101,102 | 1,120 | runTest | 102,110 | 102,110 | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.6
# Date: ... | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.6
# Date: ... | win = TestColourSelect(nb, log)
return win
#---------------------------------------------------------------------------
| win = TestColourSelect(nb, log)
return win
#---------------------------------------------------------------------------
| 7 | 1,348 | 34 | 1,382 | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.6
# Date: ... | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.6
# Date: ... | |
41,449 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ColourSelect.py | 86,87 | 27,101 | OnShowAll | TestColourSelect | 87,101 | 87,101 | class TestColourSelect(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.SetAutoLayout(True)
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(mainSizer)
t = wx.StaticText(self, -1,
"This exam... | class TestColourSelect(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.SetAutoLayout(True)
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(mainSizer)
t = wx.StaticText(self, -1,
"This exam... | # show the state of each button
result = []
colour = self.colourDefaults.GetColour() # default control value
result.append("Default Colour/Size: " + str(colour))
for name, button in self.buttonRefs:
colour = button.GetColour() # get the colour selection button result... | # show the state of each button
result = []
colour = self.colourDefaults.GetColour() # default control value
result.append("Default Colour/Size: " + str(colour))
for name, button in self.buttonRefs:
colour = button.GetColour() # get the colour selection button result... | 64 | 893 | 166 | 1,059 | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.6
# Date: ... | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.6
# Date: ... |
41,450 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ComboBox.py | 76,77 | 1,112 | runTest | 77,83 | 77,83 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestComboBox(wx.Panel):
def OnSetFocus(self, evt):
# print("OnSetFocus")
evt.Skip()
def OnKillFocus(self, evt):
# print("OnKillFocus")
evt.Skip()
def __init... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestComboBox(wx.Panel):
def OnSetFocus(self, evt):
# print("OnSetFocus")
evt.Skip()
def OnKillFocus(self, evt):
# print("OnKillFocus")
evt.Skip()
def __init... | win = TestComboBox(nb, log)
return win
#---------------------------------------------------------------------------
| win = TestComboBox(nb, log)
return win
#---------------------------------------------------------------------------
| 7 | 1,259 | 30 | 1,289 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestComboBox(wx.Panel):
def OnSetFocus(self, evt):
# print("OnSetFocus")
evt.Skip()
def OnKillFocus(self, evt):
# print("OnKillFocus")
evt.Skip()
def __init... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestComboBox(wx.Panel):
def OnSetFocus(self, evt):
# print("OnSetFocus")
evt.Skip()
def OnKillFocus(self, evt):
# print("OnKillFocus")
evt.Skip()
def __init... | |
41,451 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ComboBox.py | 64,65 | 7,76 | EvtText | TestComboBox | 65,70 | 65,70 | class TestComboBox(wx.Panel):
def OnSetFocus(self, evt):
# print("OnSetFocus")
evt.Skip()
def OnKillFocus(self, evt):
# print("OnKillFocus")
evt.Skip()
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ... | class TestComboBox(wx.Panel):
def OnSetFocus(self, evt):
# print("OnSetFocus")
evt.Skip()
def OnKillFocus(self, evt):
# print("OnKillFocus")
evt.Skip()
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sampleList = ... | self.log.WriteText('EvtText: %s\n' % evt.GetString())
evt.Skip()
# Capture events when the user types something into the control then
# hits ENTER.
| self.log.WriteText('EvtText: %s\n' % evt.GetString())
evt.Skip()
# Capture events when the user types something into the control then
# hits ENTER.
| 20 | 825 | 60 | 885 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestComboBox(wx.Panel):
def OnSetFocus(self, evt):
# print("OnSetFocus")
evt.Skip()
def OnKillFocus(self, evt):
# print("OnKillFocus")
evt.Skip()
def __init... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestComboBox(wx.Panel):
def OnSetFocus(self, evt):
# print("OnSetFocus")
evt.Skip()
def OnKillFocus(self, evt):
# print("OnKillFocus")
evt.Skip()
def __init... |
41,452 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ComboCtrl.py | 130,131 | 1,154 | runTest | 131,138 | 131,138 | #!/usr/bin/env python
import wx
import os
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# This class is used to provide an interface between a ComboCtrl and the
# ListCtrl that is used as the popup for the combo widget... | #!/usr/bin/env python
import wx
import os
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# This class is used to provide an interface between a ComboCtrl and the
# ListCtrl that is used as the popup for the combo widget... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 1,436 | 30 | 1,466 | #!/usr/bin/env python
import wx
import os
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# This class is used to provide an interface between a ComboCtrl and the
# ListCtrl that is used as the popup for the combo widget... | #!/usr/bin/env python
import wx
import os
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# This class is used to provide an interface between a ComboCtrl and the
# ListCtrl that is used as the popup for the combo widget... | |
41,453 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ComboCtrl.py | 28,29 | 13,110 | OnLeftDown | ListCtrlComboPopup | 29,39 | 29,39 | class ListCtrlComboPopup(wx.ComboPopup):
def __init__(self):
wx.ComboPopup.__init__(self)
self.lc = None
def AddItem(self, txt):
self.lc.InsertItem(self.lc.GetItemCount(), txt)
def OnMotion(self, evt):
item, flags = self.lc.HitTest(evt.GetPosition())
if item >= 0:
... | class ListCtrlComboPopup(wx.ComboPopup):
def __init__(self):
wx.ComboPopup.__init__(self)
self.lc = None
def AddItem(self, txt):
self.lc.InsertItem(self.lc.GetItemCount(), txt)
def OnMotion(self, evt):
item, flags = self.lc.HitTest(evt.GetPosition())
if item >= 0:
... | self.value = self.curitem
self.Dismiss()
# The following methods are those that are overridable from the
# ComboPopup base class. Most of them are not required, but all
# are shown here for demonstration purposes.
# This is called immediately after construction finishes. You can
... | self.value = self.curitem
self.Dismiss()
# The following methods are those that are overridable from the
# ComboPopup base class. Most of them are not required, but all
# are shown here for demonstration purposes.
# This is called immediately after construction finishes. You can
... | 55 | 947 | 110 | 1,057 | #!/usr/bin/env python
import wx
import os
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# This class is used to provide an interface between a ComboCtrl and the
# ListCtrl that is used as the popup for the combo widget... | #!/usr/bin/env python
import wx
import os
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# This class is used to provide an interface between a ComboCtrl and the
# ListCtrl that is used as the popup for the combo widget... |
41,454 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ComboTreeBox.py | 53,54 | 1,72 | runTest | 54,61 | 54,61 | #!/usr/bin/env python
import wx
from wx.lib.combotreebox import ComboTreeBox
#---------------------------------------------------------------------------
class TestComboTreeBox(wx.Panel):
def __init__(self, parent, log):
super(TestComboTreeBox, self).__init__(parent)
self.log = log
pane... | #!/usr/bin/env python
import wx
from wx.lib.combotreebox import ComboTreeBox
#---------------------------------------------------------------------------
class TestComboTreeBox(wx.Panel):
def __init__(self, parent, log):
super(TestComboTreeBox, self).__init__(parent)
self.log = log
pane... | win = TestComboTreeBox(nb, log)
return win
#---------------------------------------------------------------------------
| win = TestComboTreeBox(nb, log)
return win
#---------------------------------------------------------------------------
| 7 | 665 | 33 | 698 | #!/usr/bin/env python
import wx
from wx.lib.combotreebox import ComboTreeBox
#---------------------------------------------------------------------------
class TestComboTreeBox(wx.Panel):
def __init__(self, parent, log):
super(TestComboTreeBox, self).__init__(parent)
self.log = log
pane... | #!/usr/bin/env python
import wx
from wx.lib.combotreebox import ComboTreeBox
#---------------------------------------------------------------------------
class TestComboTreeBox(wx.Panel):
def __init__(self, parent, log):
super(TestComboTreeBox, self).__init__(parent)
self.log = log
pane... | |
41,455 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ComboTreeBox.py | 25,26 | 10,53 | _createComboTreeBox | TestComboTreeBox | 26,36 | 26,36 | class TestComboTreeBox(wx.Panel):
def __init__(self, parent, log):
super(TestComboTreeBox, self).__init__(parent)
self.log = log
panelSizer = wx.FlexGridSizer(cols=2)
panelSizer.AddGrowableCol(1)
for style, labelText in [(0, 'Default style:'),
... | class TestComboTreeBox(wx.Panel):
def __init__(self, parent, log):
super(TestComboTreeBox, self).__init__(parent)
self.log = log
panelSizer = wx.FlexGridSizer(cols=2)
panelSizer.AddGrowableCol(1)
for style, labelText in [(0, 'Default style:'),
... | comboBox = ComboTreeBox(self, style=style)
self._bindEventHandlers(comboBox)
for i in range(5):
child = comboBox.Append('Item %d'%i)
for j in range(5):
grandChild = comboBox.Append('Item %d.%d'%(i,j), child)
for k in range(5):
... | comboBox = ComboTreeBox(self, style=style)
self._bindEventHandlers(comboBox)
for i in range(5):
child = comboBox.Append('Item %d'%i)
for j in range(5):
grandChild = comboBox.Append('Item %d.%d'%(i,j), child)
for k in range(5):
... | 32 | 412 | 141 | 553 | #!/usr/bin/env python
import wx
from wx.lib.combotreebox import ComboTreeBox
#---------------------------------------------------------------------------
class TestComboTreeBox(wx.Panel):
def __init__(self, parent, log):
super(TestComboTreeBox, self).__init__(parent)
self.log = log
pane... | #!/usr/bin/env python
import wx
from wx.lib.combotreebox import ComboTreeBox
#---------------------------------------------------------------------------
class TestComboTreeBox(wx.Panel):
def __init__(self, parent, log):
super(TestComboTreeBox, self).__init__(parent)
self.log = log
pane... |
41,456 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ContextHelp.py | 92,93 | 1,113 | runTest | 93,100 | 93,100 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
# We first have to set an application-wide help provider. Normally you
# would do this in your app's OnInit or in other startup code...
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
# This pan... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
# We first have to set an application-wide help provider. Normally you
# would do this in your app's OnInit or in other startup code...
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
# This pan... | win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
| 7 | 1,200 | 30 | 1,230 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
# We first have to set an application-wide help provider. Normally you
# would do this in your app's OnInit or in other startup code...
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
# This pan... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
# We first have to set an application-wide help provider. Normally you
# would do this in your app's OnInit or in other startup code...
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
# This pan... | |
41,457 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/ContextHelp.py | 85,86 | 14,92 | OnCtxHelp2 | TestPanel | 86,92 | 86,92 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
# This help text, set for the panel itself, will be used if context
# sensitive help cannot be found for any particular control.
self.SetHelpText("This is a wx.Pane... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
# This help text, set for the panel itself, will be used if context
# sensitive help cannot be found for any particular control.
self.SetHelpText("This is a wx.Pane... | self.log.write("OnCtxHelp2: %s\n" % evt)
tip = wx.TipWindow(self, "This is a wx.TipWindow")
#----------------------------------------------------------------------
| self.log.write("OnCtxHelp2: %s\n" % evt)
tip = wx.TipWindow(self, "This is a wx.TipWindow")
#----------------------------------------------------------------------
| 12 | 953 | 56 | 1,009 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
# We first have to set an application-wide help provider. Normally you
# would do this in your app's OnInit or in other startup code...
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
# This pan... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
# We first have to set an application-wide help provider. Normally you
# would do this in your app's OnInit or in other startup code...
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
# This pan... |
41,459 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Cursor.py | 204,205 | 155,213 | OnDrawDot | CursorTestPanel | 205,213 | 205,213 | class CursorTestPanel(wx.Panel):
"""
Cursor Test Panel inspired by AniFX cursor test panel.
"""
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1, style=wx.BORDER_SUNKEN)
# Create all the widgets for the test panel.
pnl = wx.Panel(self, -... | class CursorTestPanel(wx.Panel):
"""
Cursor Test Panel inspired by AniFX cursor test panel.
"""
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1, style=wx.BORDER_SUNKEN)
# Create all the widgets for the test panel.
pnl = wx.Panel(self, -... | # Draw a dot so the user can see where the hotspot is.
dc = wx.ClientDC(self.win)
dc.SetPen(wx.Pen("RED"))
dc.SetBrush(wx.Brush("RED"))
pos = event.GetPosition()
dc.DrawCircle(pos.x, pos.y, 4)
| # Draw a dot so the user can see where the hotspot is.
dc = wx.ClientDC(self.win)
dc.SetPen(wx.Pen("RED"))
dc.SetBrush(wx.Brush("RED"))
pos = event.GetPosition()
dc.DrawCircle(pos.x, pos.y, 4)
| 24 | 787 | 102 | 889 | #!/usr/bin/env python
#-Imports----------------------------------------------------------------------
#--Python Imports.
import os
import sys
#--wxPython Imports.
import wx
from wx.lib.embeddedimage import PyEmbeddedImage
#-Globals----------------------------------------------------------------------
paperairplane... | #!/usr/bin/env python
#-Imports----------------------------------------------------------------------
#--Python Imports.
import os
import sys
#--wxPython Imports.
import wx
from wx.lib.embeddedimage import PyEmbeddedImage
#-Globals----------------------------------------------------------------------
paperairplane... |
41,460 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Cursor.py | 144,145 | 109,155 | OnMotion | DrawWindow | 145,155 | 145,155 | class DrawWindow(wx.Window):
def __init__(self, parent, log, id=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=0):
wx.Window.__init__(self, parent, id, pos, size, style)
self.log = log
self.SetBackgroundColour(wx.WHITE)
self.lines = []
self.x =... | class DrawWindow(wx.Window):
def __init__(self, parent, log, id=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=0):
wx.Window.__init__(self, parent, id, pos, size, style)
self.log = log
self.SetBackgroundColour(wx.WHITE)
self.lines = []
self.x =... | if self.HasCapture() and event.Dragging():
dc = wx.ClientDC(self)
dc.SetPen(wx.Pen(wx.BLUE, 1))
evtPos = event.GetPosition()
coords = (self.x, self.y) + (evtPos.x, evtPos.y)
self.curLine.append(coords)
dc.DrawLine(*coords)
self.... | if self.HasCapture() and event.Dragging():
dc = wx.ClientDC(self)
dc.SetPen(wx.Pen(wx.BLUE, 1))
evtPos = event.GetPosition()
coords = (self.x, self.y) + (evtPos.x, evtPos.y)
self.curLine.append(coords)
dc.DrawLine(*coords)
self.... | 25 | 413 | 138 | 551 | #!/usr/bin/env python
#-Imports----------------------------------------------------------------------
#--Python Imports.
import os
import sys
#--wxPython Imports.
import wx
from wx.lib.embeddedimage import PyEmbeddedImage
#-Globals----------------------------------------------------------------------
paperairplane... | #!/usr/bin/env python
#-Imports----------------------------------------------------------------------
#--Python Imports.
import os
import sys
#--wxPython Imports.
import wx
from wx.lib.embeddedimage import PyEmbeddedImage
#-Globals----------------------------------------------------------------------
paperairplane... |
41,461 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Cursor.py | 251,252 | 213,318 | OnChooseCursor | TestPanel | 252,307 | 252,307 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create a list of choices from the dictionary above.
choices = sorted(cursors)
# Create the controls.
self.cb = wx.ComboBox(self, -1, "wx.CURSOR_DEFAULT",... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
# Create a list of choices from the dictionary above.
choices = sorted(cursors)
# Create the controls.
self.cb = wx.ComboBox(self, -1, "wx.CURSOR_DEFAULT",... | # Clear the dots.
self.testPanel.win.Refresh()
self.testPanel.drawWin.lines = []
self.testPanel.drawWin.Refresh()
choice = self.cb.GetStringSelection()
self.log.WriteText("Selecting the %s cursor\n" % choice)
cnum = cursors[choice]
if cnum in (ID_PAPER... | # Clear the dots.
self.testPanel.win.Refresh()
self.testPanel.drawWin.lines = []
self.testPanel.drawWin.Refresh()
choice = self.cb.GetStringSelection()
self.log.WriteText("Selecting the %s cursor\n" % choice)
cnum = cursors[choice]
if cnum in (ID_PAPER... | 198 | 603 | 892 | 1,495 | #!/usr/bin/env python
#-Imports----------------------------------------------------------------------
#--Python Imports.
import os
import sys
#--wxPython Imports.
import wx
from wx.lib.embeddedimage import PyEmbeddedImage
#-Globals----------------------------------------------------------------------
paperairplane... | #!/usr/bin/env python
#-Imports----------------------------------------------------------------------
#--Python Imports.
import os
import sys
#--wxPython Imports.
import wx
from wx.lib.embeddedimage import PyEmbeddedImage
#-Globals----------------------------------------------------------------------
paperairplane... |
41,463 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CustomDragAndDrop.py | 269,270 | 215,277 | OnRadioButton | CustomDnDPanel | 270,277 | 270,277 | class CustomDnDPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
# Make the controls
text1 = wx.StaticText(self, -1,
"Draw a little picture in this window\n"
"then switch the mode below and drag the\... | class CustomDnDPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
# Make the controls
text1 = wx.StaticText(self, -1,
"Draw a little picture in this window\n"
"then switch the mode below and drag the\... | rb = self.FindWindowById(evt.GetId())
self.pad.SetMode(rb.GetLabel())
#----------------------------------------------------------------------
#----------------------------------------------------------------------
| rb = self.FindWindowById(evt.GetId())
self.pad.SetMode(rb.GetLabel())
#----------------------------------------------------------------------
#----------------------------------------------------------------------
| 6 | 655 | 49 | 704 | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... |
41,464 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CustomDragAndDrop.py | 149,150 | 125,186 | OnDragOver | DoodleDropTarget | 150,163 | 150,163 | class DoodleDropTarget(wx.DropTarget):
def __init__(self, window, log):
wx.DropTarget.__init__(self)
self.log = log
self.dv = window
# specify the type of data we will accept
self.data = wx.CustomDataObject(CUSTOM_DATA_FORMAT)
self.SetDataObject(self.data)
s... | class DoodleDropTarget(wx.DropTarget):
def __init__(self, window, log):
wx.DropTarget.__init__(self)
self.log = log
self.dv = window
# specify the type of data we will accept
self.data = wx.CustomDataObject(CUSTOM_DATA_FORMAT)
self.SetDataObject(self.data)
s... | self.log.WriteText("OnDragOver: %d, %d, %s\n" % (x, y, dragResultNames[d]))
# The value returned here tells the source what kind of visual
# feedback to give. For example, if wxDragCopy is returned then
# only the copy cursor will be shown, even if the source allows
# moves. Y... | self.log.WriteText("OnDragOver: %d, %d, %s\n" % (x, y, dragResultNames[d]))
# The value returned here tells the source what kind of visual
# feedback to give. For example, if wxDragCopy is returned then
# only the copy cursor will be shown, even if the source allows
# moves. Y... | 101 | 510 | 183 | 693 | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... |
41,465 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CustomDragAndDrop.py | 83,84 | 19,125 | StartDragOpperation | DoodlePad | 84,125 | 84,125 | class DoodlePad(wx.Window):
def __init__(self, parent, log):
wx.Window.__init__(self, parent, -1, style=wx.SUNKEN_BORDER)
self.log = log
self.SetBackgroundColour(wx.WHITE)
self.lines = []
self.x = self.y = 0
self.SetMode("Draw")
self.Bind(wx.EVT_LEFT_DOWN, se... | class DoodlePad(wx.Window):
def __init__(self, parent, log):
wx.Window.__init__(self, parent, -1, style=wx.SUNKEN_BORDER)
self.log = log
self.SetBackgroundColour(wx.WHITE)
self.lines = []
self.x = self.y = 0
self.SetMode("Draw")
self.Bind(wx.EVT_LEFT_DOWN, se... | # pickle the lines list
linesdata = pickle.dumps(self.lines)
# create our own data format and use it in a
# custom data object
ldata = wx.CustomDataObject(CUSTOM_DATA_FORMAT)
ldata.SetData(linesdata)
# Also create a Bitmap version of the drawing
size = s... | # pickle the lines list
linesdata = pickle.dumps(self.lines)
# create our own data format and use it in a
# custom data object
ldata = wx.CustomDataObject(CUSTOM_DATA_FORMAT)
ldata.SetData(linesdata)
# Also create a Bitmap version of the drawing
size = s... | 118 | 722 | 433 | 1,155 | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... |
41,466 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CustomDragAndDrop.py | 206,207 | 186,215 | DrawSavedLines | DoodleViewer | 207,215 | 207,215 | class DoodleViewer(wx.Window):
def __init__(self, parent, log):
wx.Window.__init__(self, parent, -1, style=wx.SUNKEN_BORDER)
self.log = log
self.SetBackgroundColour(wx.WHITE)
self.lines = []
self.x = self.y = 0
dt = DoodleDropTarget(self, log)
self.SetDropTarg... | class DoodleViewer(wx.Window):
def __init__(self, parent, log):
wx.Window.__init__(self, parent, -1, style=wx.SUNKEN_BORDER)
self.log = log
self.SetBackgroundColour(wx.WHITE)
self.lines = []
self.x = self.y = 0
dt = DoodleDropTarget(self, log)
self.SetDropTarg... | dc.SetPen(wx.Pen(wx.RED, 3))
for line in self.lines:
for coords in line:
dc.DrawLine(*coords)
#----------------------------------------------------------------------
| dc.SetPen(wx.Pen(wx.RED, 3))
for line in self.lines:
for coords in line:
dc.DrawLine(*coords)
#----------------------------------------------------------------------
| 12 | 223 | 64 | 287 | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... |
41,467 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CustomDragAndDrop.py | 311,312 | 310,314 | WriteText | DummyLog | 312,314 | 312,314 | class DummyLog:
def WriteText(self, text):
FILL_FUNC_BODY | class DummyLog:
def WriteText(self, text):
FILL_FUNC_BODY | sys.stdout.write(text)
| sys.stdout.write(text)
| 1 | 27 | 14 | 41 | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... |
41,468 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/CustomDragAndDrop.py | 319,320 | 314,333 | MakeFrame | TestApp | 320,333 | 320,333 | class TestApp(wx.App):
def OnInit(self):
self.MakeFrame()
return True
def MakeFrame(self, event=None):
FILL_FUNC_BODY | class TestApp(wx.App):
def OnInit(self):
self.MakeFrame()
return True
def MakeFrame(self, event=None):
FILL_FUNC_BODY | frame = wx.Frame(None, -1, "Custom Drag and Drop", size=(550,400))
menu = wx.Menu()
item = menu.Append(-1, "Window")
mb = wx.MenuBar()
mb.Append(menu, "New")
frame.SetMenuBar(mb)
frame.Bind(wx.EVT_MENU, self.MakeFrame, item)
... | frame = wx.Frame(None, -1, "Custom Drag and Drop", size=(550,400))
menu = wx.Menu()
item = menu.Append(-1, "Window")
mb = wx.MenuBar()
mb.Append(menu, "New")
frame.SetMenuBar(mb)
frame.Bind(wx.EVT_MENU, self.MakeFrame, item)
... | 32 | 52 | 157 | 209 | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... | #!/usr/bin/env python
import pickle
import wx
CUSTOM_DATA_FORMAT = wx.DataFormat('org.wxpython.DoodleLines')
#----------------------------------------------------------------------
dragResultNames = {
wx.DragError : 'DragError',
wx.DragNone : 'DragNone',
wx.DragCopy : 'DragCopy',
wx.DragMove : 'Dra... |
41,470 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DelayedResult.py | 65,66 | 54,134 | setLog | FrameSimpleDelayed | 66,69 | 66,69 | class FrameSimpleDelayed(FrameSimpleDelayedBase):
"""This demos simplistic use of delayedresult module."""
def __init__(self, *args, **kwargs):
FrameSimpleDelayedBase.__init__(self, *args, **kwargs)
self.jobID = 0
self.abortEvent = delayedresult.AbortEvent()
self.Bind(wx.EVT_CLO... | class FrameSimpleDelayed(FrameSimpleDelayedBase):
"""This demos simplistic use of delayedresult module."""
def __init__(self, *args, **kwargs):
FrameSimpleDelayedBase.__init__(self, *args, **kwargs)
self.jobID = 0
self.abortEvent = delayedresult.AbortEvent()
self.Bind(wx.EVT_CLO... | self.log = log
| self.log = log
| 3 | 751 | 12 | 763 | #!/usr/bin/env python
"""
This demonstrates a simple use of delayedresult: get/compute
something that takes a long time, without hanging the GUI while this
is taking place.
The top button runs a small GUI that uses wx.lib.delayedresult.startWorker
to wrap a long-running function into a separate thread. Just click
Get... | #!/usr/bin/env python
"""
This demonstrates a simple use of delayedresult: get/compute
something that takes a long time, without hanging the GUI while this
is taking place.
The top button runs a small GUI that uses wx.lib.delayedresult.startWorker
to wrap a long-running function into a separate thread. Just click
Get... |
41,471 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DelayedResult.py | 160,161 | 134,190 | _resultProducer | FrameSimpleDirect | 166,171 | 161,171 | class FrameSimpleDirect(FrameSimpleDelayedBase):
"""This does not use delayedresult so the GUI will freeze while
the GET is taking place."""
def __init__(self, *args, **kwargs):
self.jobID = 1
FrameSimpleDelayedBase.__init__(self, *args, **kwargs)
def setLog(self, log):
self.l... | class FrameSimpleDirect(FrameSimpleDelayedBase):
"""This does not use delayedresult so the GUI will freeze while
the GET is taking place."""
def __init__(self, *args, **kwargs):
self.jobID = 1
FrameSimpleDelayedBase.__init__(self, *args, **kwargs)
def setLog(self, log):
self.l... | import time
time.sleep(5)
return jobID
| """
Pretend to be a complex worker function or something that takes
long time to run due to network access etc. GUI will freeze if this
method is not called in separate thread.
"""
import time
time.sleep(5)
return jobID
| 5 | 434 | 24 | 458 | #!/usr/bin/env python
"""
This demonstrates a simple use of delayedresult: get/compute
something that takes a long time, without hanging the GUI while this
is taking place.
The top button runs a small GUI that uses wx.lib.delayedresult.startWorker
to wrap a long-running function into a separate thread. Just click
Get... | #!/usr/bin/env python
"""
This demonstrates a simple use of delayedresult: get/compute
something that takes a long time, without hanging the GUI while this
is taking place.
The top button runs a small GUI that uses wx.lib.delayedresult.startWorker
to wrap a long-running function into a separate thread. Just click
Get... |
41,472 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DelayedResult.py | 214,215 | 190,223 | OnButton2 | TestPanel | 215,223 | 215,223 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
vsizer = wx.BoxSizer(wx.VERTICAL)
b = wx.Button(self, -1, "Long-running function in separate thread")
vsizer.Add(b, 0, wx.ALL, 5)
self.Bind(wx.EVT_BUTTON, s... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
vsizer = wx.BoxSizer(wx.VERTICAL)
b = wx.Button(self, -1, "Long-running function in separate thread")
vsizer.Add(b, 0, wx.ALL, 5)
self.Bind(wx.EVT_BUTTON, s... | frame = FrameSimpleDirect(self, title="Long-running function in GUI thread")
frame.setLog(self.log.WriteText)
frame.Show()
#---------------------------------------------------------------------------
| frame = FrameSimpleDirect(self, title="Long-running function in GUI thread")
frame.setLog(self.log.WriteText)
frame.Show()
#---------------------------------------------------------------------------
| 11 | 318 | 57 | 375 | #!/usr/bin/env python
"""
This demonstrates a simple use of delayedresult: get/compute
something that takes a long time, without hanging the GUI while this
is taking place.
The top button runs a small GUI that uses wx.lib.delayedresult.startWorker
to wrap a long-running function into a separate thread. Just click
Get... | #!/usr/bin/env python
"""
This demonstrates a simple use of delayedresult: get/compute
something that takes a long time, without hanging the GUI while this
is taking place.
The top button runs a small GUI that uses wx.lib.delayedresult.startWorker
to wrap a long-running function into a separate thread. Just click
Get... |
41,473 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Dialog.py | 137,138 | 1,170 | runTest | 138,145 | 138,145 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
# Create and set a help provider. Normally you would do this in
# the app's OnInit as it must be done before any SetHelpText calls.
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
#---------... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
# Create and set a help provider. Normally you would do this in
# the app's OnInit as it must be done before any SetHelpText calls.
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
#---------... | win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
| 7 | 1,861 | 30 | 1,891 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
# Create and set a help provider. Normally you would do this in
# the app's OnInit as it must be done before any SetHelpText calls.
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
#---------... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
# Create and set a help provider. Normally you would do this in
# the app's OnInit as it must be done before any SetHelpText calls.
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
#---------... | |
41,474 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Dialog.py | 115,116 | 85,137 | OnShowWindowModal | TestPanel | 116,121 | 116,121 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a custom Dialog", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)
b = wx.Button(self, -1, "Show dialog with ShowWindow... | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a custom Dialog", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)
b = wx.Button(self, -1, "Show dialog with ShowWindow... | dlg = TestDialog(self, -1, "Sample Dialog", size=(350, 200),
style=wx.DEFAULT_DIALOG_STYLE)
dlg.ShowWindowModal()
| dlg = TestDialog(self, -1, "Sample Dialog", size=(350, 200),
style=wx.DEFAULT_DIALOG_STYLE)
dlg.ShowWindowModal()
| 10 | 494 | 63 | 557 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
# Create and set a help provider. Normally you would do this in
# the app's OnInit as it must be done before any SetHelpText calls.
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
#---------... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
# Create and set a help provider. Normally you would do this in
# the app's OnInit as it must be done before any SetHelpText calls.
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
#---------... |
41,475 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DialogUnits.py | 108,109 | 1,129 | runTest | 109,114 | 109,114 | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# Copyright: (c... | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# Copyright: (c... | win = MyFrame(frame, -1, "This is a test")
frame.otherWin = win
win.Show(True)
| win = MyFrame(frame, -1, "This is a test")
frame.otherWin = win
win.Show(True)
| 12 | 1,074 | 41 | 1,115 | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# Copyright: (c... | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# Copyright: (c... | |
41,476 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DialogUnits.py | 88,89 | 85,101 | OnInit | MyApp | 89,101 | 89,101 | class MyApp(wx.App):
# wxWindows calls this method to initialize the application
def OnInit(self):
FILL_FUNC_BODY | class MyApp(wx.App):
# wxWindows calls this method to initialize the application
def OnInit(self):
FILL_FUNC_BODY |
# Create an instance of our customized Frame class
frame = MyFrame(None, -1, "This is a test")
frame.Show(True)
# Tell wxWindows that this is our main window
self.SetTopWindow(frame)
# Return a success flag
return True
|
# Create an instance of our customized Frame class
frame = MyFrame(None, -1, "This is a test")
frame.Show(True)
# Tell wxWindows that this is our main window
self.SetTopWindow(frame)
# Return a success flag
return True
| 35 | 41 | 87 | 128 | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# Copyright: (c... | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# Copyright: (c... |
41,477 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DialogUnits.py | 64,65 | 20,83 | OnSize | MyFrame | 65,74 | 65,74 | class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
# First, call the base class' __init__ method to create the frame
wx.Frame.__init__(self, parent, id, title, (100, 100), (160, 100))
# Associate some events with methods of this class
self.Bind(wx.EVT_SIZE, self.OnSize... | class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
# First, call the base class' __init__ method to create the frame
wx.Frame.__init__(self, parent, id, title, (100, 100), (160, 100))
# Associate some events with methods of this class
self.Bind(wx.EVT_SIZE, self.OnSize... | size = event.GetSize()
self.sizeCtrl.SetValue("%s, %s" % (size.width, size.height))
# tell the event system to continue looking for an event handler,
# so the default handler will get called.
event.Skip()
# This method is called by the System when the window is moved,
#... | size = event.GetSize()
self.sizeCtrl.SetValue("%s, %s" % (size.width, size.height))
# tell the event system to continue looking for an event handler,
# so the default handler will get called.
event.Skip()
# This method is called by the System when the window is moved,
#... | 48 | 611 | 102 | 713 | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# Copyright: (c... | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# Copyright: (c... |
41,478 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DirDialog.py | 37,38 | 1,59 | runTest | 38,47 | 38,47 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
... | win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
| win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
| 7 | 457 | 34 | 491 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
... | |
41,479 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DirDialog.py | 16,17 | 7,37 | OnButton | TestPanel | 17,37 | 17,37 | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)
def OnButton(self, evt):
FILL_FUNC_BODY | class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)
def OnButton(self, evt):
FILL_FUNC_BODY | # In this case we include a "New directory" button.
dlg = wx.DirDialog(self, "Choose a directory:",
style=wx.DD_DEFAULT_STYLE
#| wx.DD_DIR_MUST_EXIST
#| wx.DD_CHANGE_DIR
)
# If the user se... | # In this case we include a "New directory" button.
dlg = wx.DirDialog(self, "Choose a directory:",
style=wx.DD_DEFAULT_STYLE
#| wx.DD_DIR_MUST_EXIST
#| wx.DD_CHANGE_DIR
)
# If the user se... | 73 | 117 | 213 | 330 | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
... | #!/usr/bin/env python
import wx
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
... |
41,481 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DragAndDrop.py | 56,57 | 13,96 | OnPaste | ClipTextPanel | 57,72 | 57,72 | class ClipTextPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(
wx.StaticText(
self, -1, "Copy/Paste text to/from\n"
"this window and other apps... | class ClipTextPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(
wx.StaticText(
self, -1, "Copy/Paste text to/from\n"
"this window and other apps... | success = False
do = wx.TextDataObject()
if wx.TheClipboard.Open():
success = wx.TheClipboard.GetData(do)
wx.TheClipboard.Close()
if success:
self.text.SetValue(do.GetText())
else:
wx.MessageBox(
"There is no data i... | success = False
do = wx.TextDataObject()
if wx.TheClipboard.Open():
success = wx.TheClipboard.GetData(do)
wx.TheClipboard.Close()
if success:
self.text.SetValue(do.GetText())
else:
wx.MessageBox(
"There is no data i... | 30 | 813 | 126 | 939 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... |
41,482 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DragAndDrop.py | 187,188 | 152,195 | SetLabel | FileDropPanel | 188,195 | 188,195 | class FileDropPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
#self.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False))
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(
wx.StaticText(self, -1, " \nDr... | class FileDropPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
#self.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False))
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(
wx.StaticText(self, -1, " \nDr... | self.text.SetLabel(text)
#----------------------------------------------------------------------
#----------------------------------------------------------------------
| self.text.SetLabel(text)
#----------------------------------------------------------------------
#----------------------------------------------------------------------
| 3 | 485 | 30 | 515 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... |
41,483 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DragAndDrop.py | 131,132 | 125,138 | OnDropFiles | MyFileDropTarget | 132,138 | 132,138 | class MyFileDropTarget(wx.FileDropTarget):
def __init__(self, window, log):
wx.FileDropTarget.__init__(self)
self.window = window
self.log = log
def OnDropFiles(self, x, y, filenames):
FILL_FUNC_BODY | class MyFileDropTarget(wx.FileDropTarget):
def __init__(self, window, log):
wx.FileDropTarget.__init__(self)
self.window = window
self.log = log
def OnDropFiles(self, x, y, filenames):
FILL_FUNC_BODY | txt = "\n%d file(s) dropped at %d,%d:\n" % (len(filenames), x, y)
txt += '\n'.join(filenames)
self.window.SetLabel(txt)
return True
| txt = "\n%d file(s) dropped at %d,%d:\n" % (len(filenames), x, y)
txt += '\n'.join(filenames)
self.window.SetLabel(txt)
return True
| 17 | 79 | 70 | 149 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... |
41,484 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DragAndDrop.py | 144,145 | 138,152 | OnDropText | MyTextDropTarget | 145,148 | 145,148 | class MyTextDropTarget(wx.TextDropTarget):
def __init__(self, window, log):
wx.TextDropTarget.__init__(self)
self.window = window
self.log = log
def OnDropText(self, x, y, text):
FILL_FUNC_BODY def OnDragOver(self, x, y, d):
return wx.DragCopy
| class MyTextDropTarget(wx.TextDropTarget):
def __init__(self, window, log):
wx.TextDropTarget.__init__(self)
self.window = window
self.log = log
def OnDropText(self, x, y, text):
FILL_FUNC_BODY def OnDragOver(self, x, y, d):
return wx.DragCopy
| self.window.SetLabel("(%d, %d)\n%s\n" % (x, y, text))
return True
| self.window.SetLabel("(%d, %d)\n%s\n" % (x, y, text))
return True
| 8 | 101 | 38 | 139 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... |
41,485 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DragAndDrop.py | 118,119 | 96,125 | OnData | OtherDropTarget | 119,125 | 119,125 | class OtherDropTarget(wx.DropTarget):
def __init__(self, window, log):
wx.DropTarget.__init__(self)
self.log = log
self.do = wx.FileDataObject()
self.SetDataObject(self.do)
def OnEnter(self, x, y, d):
self.log.WriteText("OnEnter: %d, %d, %d\n" % (x, y, d))
return... | class OtherDropTarget(wx.DropTarget):
def __init__(self, window, log):
wx.DropTarget.__init__(self)
self.log = log
self.do = wx.FileDataObject()
self.SetDataObject(self.do)
def OnEnter(self, x, y, d):
self.log.WriteText("OnEnter: %d, %d, %d\n" % (x, y, d))
return... | self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
self.GetData()
self.log.SetLabel("%s\n" % self.do.GetFilenames())
return d
| self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
self.GetData()
self.log.SetLabel("%s\n" % self.do.GetFilenames())
return d
| 14 | 270 | 73 | 343 | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... | #!/usr/bin/env python
import wx
#----------------------------------------------------------------------
ID_CopyBtn = wx.NewIdRef()
ID_PasteBtn = wx.NewIdRef()
ID_BitmapBtn = wx.NewIdRef()
#----------------------------------------------------------------------
class ClipTextPanel(wx.Panel):
def __in... |
41,488 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DragImage.py | 16,17 | 8,41 | HitTest | DragShape | 17,20 | 17,20 | class DragShape:
def __init__(self, bmp):
self.bmp = bmp
self.pos = (0,0)
self.shown = True
self.text = None
self.fullscreen = False
def HitTest(self, pt):
FILL_FUNC_BODY def GetRect(self):
return wx.Rect(self.pos[0], self.pos[1],
self.bm... | class DragShape:
def __init__(self, bmp):
self.bmp = bmp
self.pos = (0,0)
self.shown = True
self.text = None
self.fullscreen = False
def HitTest(self, pt):
FILL_FUNC_BODY def GetRect(self):
return wx.Rect(self.pos[0], self.pos[1],
self.bm... | rect = self.GetRect()
return rect.Contains(pt)
| rect = self.GetRect()
return rect.Contains(pt)
| 5 | 254 | 22 | 276 | #!/usr/bin/env python
import wx
import images
#----------------------------------------------------------------------
class DragShape:
def __init__(self, bmp):
self.bmp = bmp
self.pos = (0,0)
self.shown = True
self.text = None
self.fullscreen = False
def HitTest(self,... | #!/usr/bin/env python
import wx
import images
#----------------------------------------------------------------------
class DragShape:
def __init__(self, bmp):
self.bmp = bmp
self.pos = (0,0)
self.shown = True
self.text = None
self.fullscreen = False
def HitTest(self,... |
41,489 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DragScroller.py | 8,9 | 1,60 | runTest | 9,12 | 9,12 | #!/usr/bin/env python
import wx
import wx.lib.dragscroller
#-------------------------------------------------------------------------------
def runTest(frame, nb, log):
FILL_FUNC_BODYclass DragScrollerExample(wx.ScrolledWindow):
def __init__(self, parent, id=-1):
wx.ScrolledWindow.__init__(self, parent, ... | #!/usr/bin/env python
import wx
import wx.lib.dragscroller
#-------------------------------------------------------------------------------
def runTest(frame, nb, log):
FILL_FUNC_BODYclass DragScrollerExample(wx.ScrolledWindow):
def __init__(self, parent, id=-1):
wx.ScrolledWindow.__init__(self, parent, ... | win = DragScrollerExample(nb, -1)
return win
| win = DragScrollerExample(nb, -1)
return win
| 6 | 553 | 23 | 576 | #!/usr/bin/env python
import wx
import wx.lib.dragscroller
#-------------------------------------------------------------------------------
def runTest(frame, nb, log):
FILL_FUNC_BODYclass DragScrollerExample(wx.ScrolledWindow):
def __init__(self, parent, id=-1):
wx.ScrolledWindow.__init__(self, parent, ... | #!/usr/bin/env python
import wx
import wx.lib.dragscroller
#-------------------------------------------------------------------------------
def runTest(frame, nb, log):
FILL_FUNC_BODYclass DragScrollerExample(wx.ScrolledWindow):
def __init__(self, parent, id=-1):
wx.ScrolledWindow.__init__(self, parent, ... | |
41,490 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DragScroller.py | 23,24 | 12,48 | OnPaint | DragScrollerExample | 24,39 | 24,39 | class DragScrollerExample(wx.ScrolledWindow):
def __init__(self, parent, id=-1):
wx.ScrolledWindow.__init__(self, parent, id)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
self.SetScrollbars(1,... | class DragScrollerExample(wx.ScrolledWindow):
def __init__(self, parent, id=-1):
wx.ScrolledWindow.__init__(self, parent, id)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
self.SetScrollbars(1,... | dc = wx.PaintDC(self)
self.PrepareDC(dc)
pen = wx.Pen(wx.BLACK, 5)
dc.SetPen(pen)
for y in range(10):
for x in range(10):
dc.DrawCircle(x*400+20, y*400+20, 200)
dc.DrawText('Right click and drag in the direction you want to scroll.',
... | dc = wx.PaintDC(self)
self.PrepareDC(dc)
pen = wx.Pen(wx.BLACK, 5)
dc.SetPen(pen)
for y in range(10):
for x in range(10):
dc.DrawCircle(x*400+20, y*400+20, 200)
dc.DrawText('Right click and drag in the direction you want to scroll.',
... | 46 | 241 | 183 | 424 | #!/usr/bin/env python
import wx
import wx.lib.dragscroller
#-------------------------------------------------------------------------------
def runTest(frame, nb, log):
win = DragScrollerExample(nb, -1)
return win
class DragScrollerExample(wx.ScrolledWindow):
def __init__(self, parent, id=-1):
w... | #!/usr/bin/env python
import wx
import wx.lib.dragscroller
#-------------------------------------------------------------------------------
def runTest(frame, nb, log):
win = DragScrollerExample(nb, -1)
return win
class DragScrollerExample(wx.ScrolledWindow):
def __init__(self, parent, id=-1):
w... |
41,491 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DrawLinesFromBuffer.py | 9,10 | 1,132 | TestLinesFromBuffer | 10,50 | 10,50 | #!/usr/bin/env python
import time
import wx
npts = 100000
def TestLinesFromBuffer(dc, log):
FILL_FUNC_BODYclass DrawPanel(wx.Panel):
def __init__(self, parent, drawFun, log):
wx.Panel.__init__(self, parent, -1)
self.SetBackgroundColour(wx.WHITE)
self.log = log
self.drawFun = dra... | #!/usr/bin/env python
import time
import wx
npts = 100000
def TestLinesFromBuffer(dc, log):
FILL_FUNC_BODYclass DrawPanel(wx.Panel):
def __init__(self, parent, drawFun, log):
wx.Panel.__init__(self, parent, -1)
self.SetBackgroundColour(wx.WHITE)
self.log = log
self.drawFun = dra... | global npts
try:
import numpy as np
start = time.time()
w, h = dc.GetSize()
vs = np.linspace(0, 1, npts).reshape((npts, 1))
x1 = np.cos(vs * 12 * np.pi) * w/2 * vs + w/2
x2 = np.cos(vs * 16 * np.pi) * w/2 * vs + w/2
y1 = np.sin(vs * 12 * np.pi) * w/2 * ... | global npts
try:
import numpy as np
start = time.time()
w, h = dc.GetSize()
vs = np.linspace(0, 1, npts).reshape((npts, 1))
x1 = np.cos(vs * 12 * np.pi) * w/2 * vs + w/2
x2 = np.cos(vs * 16 * np.pi) * w/2 * vs + w/2
y1 = np.sin(vs * 12 * np.pi) * w/2 * ... | 170 | 878 | 510 | 1,388 | #!/usr/bin/env python
import time
import wx
npts = 100000
def TestLinesFromBuffer(dc, log):
FILL_FUNC_BODYclass DrawPanel(wx.Panel):
def __init__(self, parent, drawFun, log):
wx.Panel.__init__(self, parent, -1)
self.SetBackgroundColour(wx.WHITE)
self.log = log
self.drawFun = dra... | #!/usr/bin/env python
import time
import wx
npts = 100000
def TestLinesFromBuffer(dc, log):
FILL_FUNC_BODYclass DrawPanel(wx.Panel):
def __init__(self, parent, drawFun, log):
wx.Panel.__init__(self, parent, -1)
self.SetBackgroundColour(wx.WHITE)
self.log = log
self.drawFun = dra... | |
41,492 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/DrawLinesFromBuffer.py | 62,63 | 50,70 | OnPaint | DrawPanel | 63,70 | 63,70 | class DrawPanel(wx.Panel):
def __init__(self, parent, drawFun, log):
wx.Panel.__init__(self, parent, -1)
self.SetBackgroundColour(wx.WHITE)
self.log = log
self.drawFun = drawFun
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnSize(self, evt):
self.Refresh()
def... | class DrawPanel(wx.Panel):
def __init__(self, parent, drawFun, log):
wx.Panel.__init__(self, parent, -1)
self.SetBackgroundColour(wx.WHITE)
self.log = log
self.drawFun = drawFun
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnSize(self, evt):
self.Refresh()
def... | dc = wx.PaintDC(self)
dc.Clear()
self.drawFun(dc,self.log)
#----------------------------------------------------------------------
| dc = wx.PaintDC(self)
dc.Clear()
self.drawFun(dc,self.log)
#----------------------------------------------------------------------
| 6 | 132 | 47 | 179 | #!/usr/bin/env python
import time
import wx
npts = 100000
def TestLinesFromBuffer(dc, log):
global npts
try:
import numpy as np
start = time.time()
w, h = dc.GetSize()
vs = np.linspace(0, 1, npts).reshape((npts, 1))
x1 = np.cos(vs * 12 * np.pi) * w/2 * vs + w/2
... | #!/usr/bin/env python
import time
import wx
npts = 100000
def TestLinesFromBuffer(dc, log):
global npts
try:
import numpy as np
start = time.time()
w, h = dc.GetSize()
vs = np.linspace(0, 1, npts).reshape((npts, 1))
x1 = np.cos(vs * 12 * np.pi) * w/2 * vs + w/2
... |
41,493 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/demo/Editor.py | 8,9 | 1,71 | runTest | 9,39 | 9,39 | #!/usr/bin/env python
import wx
import wx.lib.editor as editor
#----------------------------------------------------------------------
def runTest(frame, nb, log):
FILL_FUNC_BODYoverview = """
The Editor class implements a simple text editor using wxPython. You
can create a custom editor by subclassing Editor. Eve... | #!/usr/bin/env python
import wx
import wx.lib.editor as editor
#----------------------------------------------------------------------
def runTest(frame, nb, log):
FILL_FUNC_BODYoverview = """
The Editor class implements a simple text editor using wxPython. You
can create a custom editor by subclassing Editor. Eve... | win = wx.Panel(nb, -1)
ed = editor.Editor(win, -1, style=wx.SUNKEN_BORDER)
box = wx.BoxSizer(wx.VERTICAL)
box.Add(ed, 1, wx.ALL|wx.GROW, 1)
win.SetSizer(box)
win.SetAutoLayout(True)
ed.SetText(["",
"This is a simple text editor, the class name is",
"Editor. ... | win = wx.Panel(nb, -1)
ed = editor.Editor(win, -1, style=wx.SUNKEN_BORDER)
box = wx.BoxSizer(wx.VERTICAL)
box.Add(ed, 1, wx.ALL|wx.GROW, 1)
win.SetSizer(box)
win.SetAutoLayout(True)
ed.SetText(["",
"This is a simple text editor, the class name is",
"Editor. ... | 104 | 306 | 346 | 652 | #!/usr/bin/env python
import wx
import wx.lib.editor as editor
#----------------------------------------------------------------------
def runTest(frame, nb, log):
FILL_FUNC_BODYoverview = """
The Editor class implements a simple text editor using wxPython. You
can create a custom editor by subclassing Editor. Eve... | #!/usr/bin/env python
import wx
import wx.lib.editor as editor
#----------------------------------------------------------------------
def runTest(frame, nb, log):
FILL_FUNC_BODYoverview = """
The Editor class implements a simple text editor using wxPython. You
can create a custom editor by subclassing Editor. Eve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.